What are the differences between a TreeWalker and a NodeIterator?
Both a TreeWalker
object and a NodeIterator
object can be used to traverse a DOM tree starting from a given node. The APIs to use them, and even the APIs to create them, createTreeWalker
and createNodeIterator
look virtually identical. Both seem about equally old and neither seems to be deprecated in favour of the other.