Skip to content

Instantly share code, notes, and snippets.

@arvidkahl
Created January 27, 2016 17:48
Show Gist options
  • Save arvidkahl/34205ec73f3618aa5de9 to your computer and use it in GitHub Desktop.
Save arvidkahl/34205ec73f3618aa5de9 to your computer and use it in GitHub Desktop.
Count DOM Element type occurrences on a page
[].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