Dom的增删改查

1、创建

createElement

2、增

appendChild、insertBefore

3、改

添加类classList.add\remove、setAttribute

4、查

querySelector、querySelectorAll

父:parentNode、parentElement

子:child

兄:previousElementSibling、nextElementSibling

5、属性操作

setAttribute、getAttribute、removeAttribute

posted @   洛飞  阅读(66)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术
· .NET周刊【3月第1期 2025-03-02】
点击右上角即可分享
微信分享提示