I am not able to replace .innerHtml for a div tag which is nested in other div tags. I used firebug to make sure that getElementById() is working.
<div class="a">
<div class="b"><a href="myUrl"><div id="hello"></div></a></div>
</div>
In javascript code I am using:
document.getElementById("hello").innerHTML = "hello world";
Using firebug, I have verified that “hello” div is picked up (that is, it is not null). But the string “hello world” is not showing up.
Kindly help.
Thanks.
use
innerHTMLrather thaninnerHtml. note the capitalization.On a side note, IE also supports
innerText.