files/en-us/web/api/nodeiterator/index.md
{{APIRef("DOM")}}
The NodeIterator interface represents an iterator to traverse nodes of a DOM subtree in document order.
A NodeIterator can be created using the {{domxref("Document.createNodeIterator()")}} method, as follows:
const nodeIterator = document.createNodeIterator(root, whatToShow, filter);
This interface doesn't inherit any property.
NodeIterator was created.unsigned long bitmask that describes the types of {{domxref("Node")}}
to be matched. Non-matching nodes are skipped, but relevant child nodes may be included.NodeFilter used to select the relevant nodes.NodeIterator is anchored before the {{domxref("NodeIterator.referenceNode")}}. If false, it indicates that the iterator is anchored after the reference node.This interface doesn't inherit any method.
NodeIterator as disposed, so it could be reclaimed by garbage collection.null if there are none.null if there are none.{{Specifications}}
{{Compat}}