特性/方法

类型/返回类型

   

nodeName

String

节点的名字;根据节点的类型而定义

nodeValue

String

节点的值;根据节点的类型而定义

nodeType

Number

节点的类型常量值之一

ownerDocument

Document

指向这个节点所属的文档

firstChild

Node

指向在childNodes列表中的第一个节点

lastChild

Node

指向在childNodes列表中的最后一个节点

childNodes

NodeList

所有子节点的列表

Node接口也定义了一些所有节点类型都包含的特性和方法previousSibling

Node

指向前一个兄弟节点;如果这个节点就是第一个兄弟节点,那么该值为null

nextSibling

Node

指向后一个兄弟节点;如果这个节点就是最后一个兄弟节点,那么该值为null

hasChildNodes()

Boolean

childNodes包含一个或多个节点时,返回真

attributes

NamedNodeMap

包含了代表一个元素的特性的Attr对象;仅用于Element节点

appendChild(node)

Node

node添加到childNodes的末尾

removeChild(node)

Node

childNodes中删除node

replaceChild
(newnode, oldnode)

Node

childNodes中的oldnode替换成newnode

insertBefore
(newnode, refnode)

Node

childNodes中的refnode之前插入newnode

相关文章:

  • 2021-06-11
  • 2021-11-17
  • 2022-12-23
  • 2021-11-01
  • 2022-12-23
  • 2021-06-25
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-11-24
  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
相关资源
相似解决方案