Created
February 12, 2013 19:17
-
-
Save cbmeeks/4772514 to your computer and use it in GitHub Desktop.
Grabbr Grab the entire friggin' DOM.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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