Guest User

Untitled

a guest
Jan 16th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. var allDivsinDom = document.getElementsByTagName('div'); //Array of all divs
  2. var allAnchorinDom = document.getElementsByTagName('a'); //Array of all a
  3. ....
  4.  
  5. function readHTML(node) {
  6. var i, child;
  7. if (node.nodeType == 1) { // only tags
  8. for (i = 0 ; i < node.childNodes.length ; ++i) {
  9. child = node.childNodes[i];
  10. // do something with node
  11. window.console.info(child.tagName);
  12. readHTML(child);
  13. }
  14. }
  15. }
  16. readHTML(document.body);
Add Comment
Please, Sign In to add comment