Skip to content

Instantly share code, notes, and snippets.

@abernier
Created December 8, 2010 00:03
Show Gist options
  • Save abernier/732669 to your computer and use it in GitHub Desktop.
Save abernier/732669 to your computer and use it in GitHub Desktop.
function walkTheDOM(node, func) {
func(node);
node = node.firstChild;
while (node) {
walkTheDOM(node, func);
node = node.nextSibling;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment