Skip to content

Instantly share code, notes, and snippets.

@ladas-larry ladas-larry/dom.js
Last active Aug 10, 2017

Embed
What would you like to do?
function walkTree(node) {
if (node == null){
return;
}
// do something with the current node here
var childNodes = node.childNodes;
for (var i = 0; i < childNodes.length; i++) {
walkTree(node.childNodes[i]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.