how to loop through all tags in html

Solutions on MaxInterview for how to loop through all tags in html by the best coders in the world

showing results for - "how to loop through all tags in html"
Liam
11 Nov 2020
1var tags = document.getElementsByTagName("*");
2for (var i=0, max=tags.length; i < max; i++) {
3   console.log(tags[i]);
4}