TreeWalker : Object

Traverses the specified document subtree.

Browser/User Agent Support

IEMozillaNetscapeOperaSafariNetscapte
no1.0+7.0+9.0+nono

Constructors

ConstructorIEMozillaNetscapeOperaSafariNetscapte
Traverses the specified document subtree.
no1.0+7.0+9.0+nono
 

Properties

PropertyIEMozillaNetscapeOperaSafariNetscapte
Current node position of the TreeWalker.
no1.0+7.0+9.0+nono
 
If true, indicates that the TreeWalker expands the entity references it encounters while traversing the document.
no1.0+7.0+9.0+nono
 
Filter used to filter nodes for traversal.
no1.0+7.0+9.0+nono
 
Specifies the node that the TreeWalker begins traversal at.
no1.0+7.0+9.0+nono
 
Specifies which Document nodes the TreeWalker will use in its traversal.
no1.0+7.0+9.0+nono
 

Methods

MethodIEMozillaNetscapeOperaSafariNetscapte
Returns first child node of the current node.
no1.0+7.0+9.0+nono
 
Returns the last child node of the current node.
no1.0+7.0+9.0+nono
 
Returns the next node in the document subtree.
no1.0+7.0+9.0+nono
 
Returns the next sibling node of the current node.
no1.0+7.0+9.0+nono
 
Returns the parent node of the current node.
no1.0+7.0+9.0+nono
 
Returns the previous node in the document subtree.
no1.0+7.0+9.0+nono
 
Returns the previous sibling of the current node.
no1.0+7.0+9.0+nono
 

References

NodeFilter | NodeIterator

Availability

HTML DOM Level 2 | W3C

Constructor Detail

TreeWalker TreeWalker()

Traverses the specified document subtree.

Visibility
internal

Property Detail

Node currentNode

Current node position of the TreeWalker.

Availability

HTML DOM Level 2 | W3C

Boolean expandEntityReferences - read only

If true, indicates that the TreeWalker expands the entity references it encounters while traversing the document.

Availability

HTML DOM Level 2 | W3C

NodeFilter filter - read only

Filter used to filter nodes for traversal.

Availability

HTML DOM Level 2 | W3C

Node root - read only

Specifies the node that the TreeWalker begins traversal at.

Availability

HTML DOM Level 2 | W3C

Number whatToShow - read only

Specifies which Document nodes the TreeWalker will use in its traversal.

Availability

HTML DOM Level 2 | W3C

Method Detail

firstChild() : static Node

Returns first child node of the current node.

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/nodetree.html

Availability

HTML DOM Level 2 | W3C

lastChild() : static Node

Returns the last child node of the current node.

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/nodetree.html

Availability

HTML DOM Level 2 | W3C

nextNode() : static Node

Returns the next node in the document subtree.

Availability

HTML DOM Level 2 | W3C

nextSibling() : static Node

Returns the next sibling node of the current node.

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/nodetree.html

Availability

HTML DOM Level 2 | W3C

parentNode() : static Node

Returns the parent node of the current node.

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/nodetree.html

Availability

HTML DOM Level 2 | W3C

previousNode() : static Node

Returns the previous node in the document subtree.

Availability

HTML DOM Level 2 | W3C

previousSibling() : static Node

Returns the previous sibling of the current node.

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/nodetree.html

Availability

HTML DOM Level 2 | W3C