Traverses the specified document subtree.
Platform Support
| IE | Mozilla | Netscape | Opera | Safari | Chrome | no | 1.0+ | 7.0+ | 9.0+ | no | no |
|---|
Constructors
| Constructor | Action | IE | Mozilla | Netscape | Opera | Safari | Chrome | ||
|---|---|---|---|---|---|---|---|---|---|
|
TreeWalker Constructor() : TreeWalker
Traverses the specified document subtree.
|
Show Details | no | 1.0+ | 7.0+ | 9.0+ | no | no | ||
TreeWalker() : TreeWalkerTraverses the specified document subtree. Returns
|
|||||||||
Properties
| Property | Action | IE | Mozilla | Netscape | Opera | Safari | Chrome |
|---|---|---|---|---|---|---|---|
|
currentNode
: Node
Current node position of the TreeWalker.
|
Show Details | no | 1.0+ | 7.0+ | 9.0+ | no | no |
|
|||||||
|
expandEntityReferences
: Boolean
If true, indicates that the TreeWalker expands the entity references it encounters while traversing the document.
|
Show Details | no | 1.0+ | 7.0+ | 9.0+ | no | no |
|
|||||||
|
filter
: NodeFilter
Filter used to filter nodes for traversal.
|
Show Details | no | 1.0+ | 7.0+ | 9.0+ | no | no |
|
|||||||
|
root
: Node
Specifies the node that the TreeWalker begins traversal at.
|
Show Details | no | 1.0+ | 7.0+ | 9.0+ | no | no |
|
|||||||
|
whatToShow
: Number
Specifies which Document nodes the TreeWalker will use in its traversal.
|
Show Details | no | 1.0+ | 7.0+ | 9.0+ | no | no |
|
|||||||
Functions
| Method | Action | IE | Mozilla | Netscape | Opera | Safari | Chrome | ||
|---|---|---|---|---|---|---|---|---|---|
|
firstChild() : Node
Returns first child node of the current node.
|
Show Details | no | 1.0+ | 7.0+ | 9.0+ | no | no | ||
|
Returns
|
|||||||||
|
lastChild() : Node
Returns the last child node of the current node.
|
Show Details | no | 1.0+ | 7.0+ | 9.0+ | no | no | ||
|
Returns
|
|||||||||
|
nextNode() : Node
Returns the next node in the document subtree.
|
Show Details | no | 1.0+ | 7.0+ | 9.0+ | no | no | ||
|
Returns
|
|||||||||
|
nextSibling() : Node
Returns the next sibling node of the current node.
|
Show Details | no | 1.0+ | 7.0+ | 9.0+ | no | no | ||
|
Returns
|
|||||||||
|
parentNode() : Node
Returns the parent node of the current node.
|
Show Details | no | 1.0+ | 7.0+ | 9.0+ | no | no | ||
|
Returns
|
|||||||||
|
previousNode() : Node
Returns the previous node in the document subtree.
|
Show Details | no | 1.0+ | 7.0+ | 9.0+ | no | no | ||
|
Returns
|
|||||||||
|
previousSibling() : Node
Returns the previous sibling of the current node.
|
Show Details | no | 1.0+ | 7.0+ | 9.0+ | no | no | ||
|
Returns
|
|||||||||
References
Availability
HTML DOM Level 2|W3C