Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
get dom element counts by tag name with jquery
var tags = {};
$("*").each(function(item) {
if (!tags[this.tagName])
tags[this.tagName] = 0;
tags[this.tagName]++;
});
tags;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.