Javascript Reference
Categories: NodeIterator

javascript NodeIterator Description

@May 8, 2008, 2:57 p.m.
NodeIterator Firefox/Netscape/NN n/a IE n/a Chrome/Safari/DOM 2  



The NodeIterator object is a "live" list of nodes that meet the criteria defined by the document.createNodeIterator( ) method. The list is a simple list of node references in source code order, but the list items do not bear any parent or descendant relationships to each other. The createNodeIterator( ) method describes the node where the list begins and which nodes (or classes of nodes) are exempt from the list by way of filtering (see the TreeWalker object for an example of this kind of filtering).


The NodeIterator object maintains a kind of pointer inside the list (so that your scripts don't have to). Methods of this object let scripts access the next or previous node in the list, while moving the pointer one position in either direction. If scripts modify the document tree after the NodeIterator is created, changes to the document tree are automatically reflected in the sequence of nodes in the NodeIterator.

Object Model Reference
Object-Specific Properties
expandEntityReference filter root whatToShow
Object-Specific Methods
detach( ) nextNode( ) previousNode( )
Object-Specific Event Handler Properties


Powered by Linode.