(1)创建新节点

  createDocumentFragment() //创建一个DOM片段

  createElement() //创建一个具体的元素

  createTextNode() //创建一个文本节点

(2) 添加、移除、替换、插入

  appendChild()

  removeChild()

  redplaceChild()

  insertBefore() //在已有的子节点前插入一个新的子节点

(3) 查找

  getElementsByTagName() //通过标签名称

  getElementsByName() //通过元素的Name属性的值(IE容错能力较强会得到一个数组,其中包括id等于name值的)

  getElementById() //通过元素Id,唯一性

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-21
  • 2021-08-25
  • 2022-12-23
  • 2022-02-05
  • 2021-12-10
  • 2022-02-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2021-05-20
  • 2021-11-21
  • 2022-12-23
相关资源
相似解决方案