DOM 重点核心 

DOM 重点核心 (黑马课程总结【侵删】)

6.1 创建 

1. document.write 
2. innerHTML 
3. createElement 

6.2 增 

1. appendChild 
2. insertBefore 

6.3 删 

1. removeChild 

6.4 改 

1. 修改元素属性: src、href、title等 
2. 修改普通元素内容: innerHTML 、innerText 
3. 修改表单元素: value、type、disabled等 
4. 修改元素样式: style、className 

6.5 查 

1. DOM提供的API 方法:  getElementById、getElementsByTagName  古老用法 不太推荐  
2.   H5提供的新方法: querySelector、querySelectorAll   提倡 
3. 利用节点操作获取元素: 父(parentNode)、子(children)、兄(previousElementSibling、 nextElementSibling)  提倡 

6.6 属性操作 

1. setAttribute:设置dom的属性值 
2. getAttribute:得到dom的属性值 
3. removeAttribute移除属性 

6.7 事件操作 

给元素注册事件, 采取  事件源.事件类型 = 事件处理程序 

DOM 重点核心 (黑马课程总结【侵删】)

 

相关文章:

  • 2021-10-12
  • 2021-11-30
  • 2021-11-09
  • 2021-08-05
  • 2021-06-12
  • 2022-02-06
  • 2021-09-12
猜你喜欢
  • 2021-11-02
  • 2022-01-18
  • 2021-06-17
  • 2021-06-17
  • 2021-06-10
  • 2021-10-27
  • 2021-10-05
相关资源
相似解决方案