Skip to content

Instantly share code, notes, and snippets.

@roman01la
Created January 26, 2014 03:43
Show Gist options
  • Save roman01la/8628082 to your computer and use it in GitHub Desktop.
Save roman01la/8628082 to your computer and use it in GitHub Desktop.
Get num of HTML nodes
c = 0
check = (node) ->
if node instanceof HTMLElement || node instanceof HTMLDocument
c++
console.log(c)
for onode in node.childNodes
check(onode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment