Dom的增删改查

1、创建

createElement

2、增

appendChild、insertBefore

3、改

添加类classList.add\remove、setAttribute

4、查

querySelector、querySelectorAll

父:parentNode、parentElement

子:child

兄:previousElementSibling、nextElementSibling

5、属性操作

setAttribute、getAttribute、removeAttribute

posted @ 2022-01-02 14:03  洛飞  阅读(64)  评论(0编辑  收藏  举报