创建---------------------------
innerHTML createElement
增加----------------------------
appendChild insertBefore
删除-------------------------------
removeChild
修改--------------------------------
元素类src , href ,title
普通元素类 innerHTML , innerText
表单元素 value,type,disabled
元素样式 style ,className
查----------------------------
(原生dom兼容性强) getElementByld,getElementByTagName
(h5新增) querySelector,querySelectorAll
获取节点 父parentNode,子children,兄弟previousElementSibling(这是上一个兄弟),nextElementSibling(下一个兄弟)
属性操作-----------------------------
自定义setAttribute
得到自定义getAttribute
移除自定义removeAttribute
事件操作----------------------------------
onclick 点击
onmouseover 鼠标移动触发
onmouseout 鼠标离开触发
onfocus 得到焦点触发
onblur 失去焦点时触发
onmouseup 鼠标弹起时触发
onmousedown 鼠标按下就立即触发
js增删改查
最新推荐文章于 2023-07-20 18:40:18 发布