GeezerVison is showing developer.mozilla.org — NodeIterator - Web APIs | MDN
NodeIterator
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
The NodeIterator interface represents an iterator to traverse nodes of a DOM subtree in document order.
A NodeIterator can be created using the Document.createNodeIterator() method, as follows:
js
const nodeIterator = document.createNodeIterator(root, whatToShow, filter);
This interface doesn't inherit any method.
NodeIterator.detach()
-
This is a legacy method, and no longer has any effect. Previously it served to mark a
NodeIterator as disposed, so it could be reclaimed by garbage collection.
NodeIterator.previousNode()
-
Returns the previous Node in the document, or null if there are none.
NodeIterator.nextNode()
-
Returns the next Node in the document, or null if there are none.