DocumentTraversal : Object

Allows you to create iterators and tree-walkers to traverse the nodes of a Document.

Browser/User Agent Support

IEMozillaNetscapeOperaSafariNetscapte
no1.0+2.0+no1.0+no

Constructors

ConstructorIEMozillaNetscapeOperaSafariNetscapte
Allows you to create iterators and tree-walkers to traverse the nodes of a Document.
no1.0+2.0+no1.0+no
 

Methods

MethodIEMozillaNetscapeOperaSafariNetscapte
Creates a new NodeIterator for the subtree at the specified node.
no1.0+2.0+no1.0+no
 
Creates a new TreeWalker for the subtree at the specified node.
no1.0+2.0+no1.0+no
 

Availability

HTML DOM Level 2 | W3C

Constructor Detail

DocumentTraversal DocumentTraversal()

Allows you to create iterators and tree-walkers to traverse the nodes of a Document.

Visibility
internal

Method Detail

createNodeIterator(Node root, Number whatToShow, [NodeFilter filter,] [Boolean entityReferenceExpansion]) : NodeIterator

Creates a new NodeIterator for the subtree at the specified node.

NoderootNode to be iterated with its children.
NumberwhatToShowSpecifies which types of nodes to show in the treeview.
NodeFilterfilterFilter to use with this NodeIterator. (optional)
BooleanentityReferenceExpansionIf true, specifies that entity reference nodes should be expanded. (optional)

Throws
Raises a NOT_SUPPORTED_ERR if the specified root is null.
Availability

HTML DOM Level 2 | W3C

createTreeWalker(Node root, Number whatToShow, [NodeFilter filter,] [Boolean entityReferenceExpansion]) : TreeWalker

Creates a new TreeWalker for the subtree at the specified node.

NoderootNode to serve as the root for the TreeWalker.
NumberwhatToShowSpecifies which types of nodes to show in the treeview.
NodeFilterfilterFilter to use with this TreeWalker. (optional)
BooleanentityReferenceExpansionIf true, specifies that entity reference nodes should be expanded. (optional)

Throws
Throws a NOT_SUPPORTED_ERR if the specified root is null.
Availability

HTML DOM Level 2 | W3C