SHARE
TWEET

Untitled

a guest Jul 17th, 2017 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'use strict';
  2.  
  3. let elements = document.querySelectorAll('*');
  4. let tags = {};
  5. for (let i = 0; i < elements.length; ++i) {
  6.   const tagName = elements[i].tagName;
  7.   if (tags[tagName] === undefined) {
  8.     tags[tagName] = 1;
  9.   } else {
  10.     tags[tagName] = tags[tagName] + 1;
  11.   }
  12. }
  13. return tags;
RAW Paste Data
Top