TreeWalker
The TreeWalker
object represents the nodes of a document subtree and a position within them.
Properties
The TreeWalker.currentNode
property represents the Node which the TreeWalker is currently pointing at.
The TreeWalker.filter
read-only property returns the NodeFilter
associated with the TreeWalker.
The TreeWalker.whatToShow
read-only property returns a bitmask that indicates the types of nodes to show.
Functions
The TreeWalker.firstChild()
method moves the current Node to the first visible child of the current node, and returns the found child.
The TreeWalker.nextSibling()
method moves the current Node to its next sibling, if any, and returns the found sibling.
The TreeWalker.parentNode()
method moves the current Node to the first visible ancestor node in the document order, and returns the found node.
The TreeWalker.previousNode()
method moves the current Node to the previous visible node in the document order, and returns the found node.
The TreeWalker.previousSibling()
method moves the current Node to its previous sibling, if any, and returns the found sibling.