Hey all,
I'm collecting html from XML files in a loop to dynamically create divs based on user selections:
Code:
for (var i = 0; i < markers.length; i++) {
currentlocation_html += '<div class="currentlocation" id="currentlocation' + (i + 1) + '">' + GXml.value(markers[i].getElementsByTagName("details")[0]) + '</div>';
}
Code:
document.getElementById("locationcontainer").innerHTML = currentlocation_html;
When I try to change the property with javascript:
Code:
document.getElementById("currentlocation" + i + "").style.displaydisplay.value="inline";
I assume that this is because the divs are not hard coded in my html and the javascript doesn't "see" the div. Am I right? Is there a way around this?
All help is greatly appreciated, thanks in advance.