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?
To find a property in one or more of all divs on a page:
var divs = document.getElementsByTagName("div"), i=divs.length; while (i--) { if (divs[i].getAttribute([yourProperty]) === 'yourValue'){ //do something } }