Tutorial by Examples

TreeWalker is a generator-like interface that makes recursively filtering nodes in a DOM tree easy and efficient. The following code concatenates the value of all Text nodes in the page, and prints the result. let parentNode = document.body; let treeWalker = document.createTreeWalker(parentNode, ...
The NodeIterator interface provides methods for iterating over nodes in a DOM tree. Given a document like this one: <html> <body> <section class="main"> <ul> <li>List Item</li> <li>List Item</li> <li>Li...

Page 1 of 1