as above. How to traverse every element of the document using javascript?
You could select all elements by passing * to getElementsByTagName() like this:
var all = document.getElementsByTagName("*");
for (var i=0; i < all.length; i++) {
console.log(all[i].nodeName);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With