Created
January 27, 2016 17:48
-
-
Save arvidkahl/34205ec73f3618aa5de9 to your computer and use it in GitHub Desktop.
Count DOM Element type occurrences on a page
This file contains 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
[].map.call(document.all,function(el){return el.nodeName}).reduce(function(prev,curr){prev[curr]=(prev[curr]||0)+1;return prev},{}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment