function adjustPosition(currentDiv)
{
try {
for (var i = 0; i < document.getElementById("parentContainer").childNodes.length; i++)
{
document.getElementById("parentContainer").childNodes[i].style.zIndex = 0;
}
currentDiv.style.zIndex = 1;
} catch (error) {
alert(error.Message);
}
}
I'm passing an HTML Div Element to the function to adjust its position by iterating through its child nodes and setting the z-index property to zero. It works correctly in Internet Explorer but returns "undefined" in Firefox and Chrome during the first iteration. Any suggestions?