Skip to content

Instantly share code, notes, and snippets.

@olarclara
Created April 13, 2017 15:34
Show Gist options
  • Save olarclara/8bcd21aa9375952da486720964931038 to your computer and use it in GitHub Desktop.
Save olarclara/8bcd21aa9375952da486720964931038 to your computer and use it in GitHub Desktop.
// Taken from Douglas Crockford's JavaScript: The Good Parts
function walkDOM(node, func) {
func(node);
node = node.firstChild;
while(node) {
walkDOM(node, func);
node = node.nextSibling;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment