TreeWalker
Summary
Provides an object that can be used to traverse filtered lists of nodes or elements in a document.
Properties
- currentNode
- Sets or retrieves where the current node in a filtered TreeWalker hierarchy is positioned.
Methods
- firstChild
- Retrieves a reference to the first child of the current node of the filtered TreeWalker hierarchy and updates currentNode.
- lastChild
- Retrieves a reference to the last child of the current node of the filtered TreeWalker hierarchy and updates currentNode.
- nextSibling
- Retrieves the next sibling of the current node in the filtered TreeWalker hierarchy and updates currentNode.
- parentNode
- Retrieves the parent object in the document hierarchy relative to the current node and updates currentNode.
- previousSibling
- Retrieves the previous sibling of the current node in the filtered TreeWalker hierarchy and updates currentNode.
Events
No events.
Notes
Remarks
The TreeWalker is dynamic, reflecting the state of the document as it is edited or changed.
Standards information
Related specifications
- DOM
- Living Standard
Attributions
Mozilla Developer Network : [TreeWalker Article]
Microsoft Developer Network: [TreeWalker Object Article]