walk-dom
v0.1.3
Published
Recursively walk the DOM
Downloads
12
Readme
Recursively walk the DOM.
Install
yarn add walk-dom
Or grab the latest UMD build.
Usage
Pass a root node and a callback. The callback will receive each node as its only argument.
walk(document.body, node => {
// ...
});
Return false
to stop descending a branch.
walk(document.body, node => {
if (!node.textContent)
return false;
});