Every DOM type (except Window) implements the Node interface.
Properties[]
These properties are available on all Node instances.
firstChild[]
Data type | Node |
---|---|
Standard | DOM Level 1DOM Level 2DOM Level 3 |
Documentation | MozillaMicrosoft |
Returns the node's first child in the tree, or null if the node is childless. If the node is a Document, this returns the first node in the list of its direct children.
nextSibling[]
Data type | Node |
---|---|
Standard | DOM Level 1DOM Level 2DOM Level 3 |
Documentation | MozillaMicrosoft |
Returns the node immediately following the current one in the parent's childNodes list, or null if this is the last node in that list.
parentNode[]
Data type | Node |
---|---|
Standard | DOM Level 1DOM Level 2DOM Level 3 |
Documentation | MozillaMicrosoft |
A reference to the node's container/parent, if any.
Methods[]
These methods are available on all Node instances.
appendChild[]
Data type | function |
---|---|
Return type | Node |
Parameter list | child (Node) |
Standard | DOM Level 1DOM Level 2DOM Level 3 |
Documentation | MozillaMicrosoft |
Adds a node to the end of the list of children of a specified parent node. If the node already exists it is removed from its current parent node, then added to the new parent node.
insertBefore[]
Data type | function |
---|---|
Return type | Node |
Parameter list | newChild (Node), refChild (Node) |
Standard | DOM Level 1DOM Level 2DOM Level 3 |
Documentation | MozillaMicrosoft |
Inserts newChild before refChild and returns newChild.
replaceChild[]
Data type | function |
---|---|
Return type | Node |
Parameter list | newChild (Node), oldChild (Node) |
Standard | DOM Level 1DOM Level 2DOM Level 3 |
Documentation | MozillaMicrosoft |
Replaces oldChild with newChild and returns oldChild.