I want to go through all the elements on a page using Javascript and see if they have a property set. Is there an easy way to do this, or do I have to use a recursive solution?
You can use:
var divs = document.getElementsByTagName("div"); for(var i = 0; i < divs.length; i++){ //do something to each div like divs[i].innerHTML = "something new..."; }
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