Answers for "how to loop through all tags in html"

0

how to loop through all tags in html

var tags = document.getElementsByTagName("*");
for (var i=0, max=tags.length; i < max; i++) {
   console.log(tags[i]);
}
Posted by: Guest on February-24-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language