Posted By

wbednarski on 04/05/11


Tagged

javascript


Versions (?)

list all tags


 / Published in: JavaScript
 

  1. (function () {
  2.  
  3. var allTags = document.body.getElementsByTagName('*'),
  4. tags = [],
  5. tg,
  6. tag,
  7. allTagsLength = allTags.length;
  8.  
  9. for (tg = 0; tg < allTagsLength; tg++) {
  10. tag = allTags[tg];
  11. tags.push(tag.nodeName);
  12. }
  13. alert(tags);
  14.  
  15. }());

Report this snippet  

You need to login to post a comment.