Skip to content

Instantly share code, notes, and snippets.

@cbmeeks
Created February 12, 2013 19:17
Show Gist options
  • Save cbmeeks/4772514 to your computer and use it in GitHub Desktop.
Save cbmeeks/4772514 to your computer and use it in GitHub Desktop.
Grabbr Grab the entire friggin' DOM.
(function() {
var grabbr = [];
var walk_the_DOM = function walk(node, func) {
func(node);
node = node.firstChild;
while (node) {
walk(node, func);
node = node.nextSibling;
}
};
walk_the_DOM(document.body, function(node) {
grabbr.push(node);
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment