loop through dom elements javascript

Solutions on MaxInterview for loop through dom elements javascript by the best coders in the world

showing results for - "loop through dom elements javascript"
Hanna
02 Apr 2017
1//Loop thru DOM elements
2
3var all = document.getElementsByTagName("*");
4
5for (var i=0, max=all.length; i < max; i++) {
6     // Do something with the element here
7}