Skip to content

Instantly share code, notes, and snippets.

@ladas-larry
Last active August 10, 2017 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ladas-larry/586fb7f1a8f00acfcb80e3339a929bff to your computer and use it in GitHub Desktop.
Save ladas-larry/586fb7f1a8f00acfcb80e3339a929bff to your computer and use it in GitHub Desktop.
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