Sun*_*Sun 2 html javascript innerhtml getelementbyid
我无法将.innerHtml替换为嵌套在其他div标签中的div标签.我用firebug来确保getElementById()正常工作.
<div class="a">
<div class="b"><a href="myUrl"><div id="hello"></div></a></div>
</div>
Run Code Online (Sandbox Code Playgroud)
在我使用的javascript代码中:
document.getElementById("hello").innerHTML = "hello world";
Run Code Online (Sandbox Code Playgroud)
使用firebug,我已经验证了"hello"div被拾取(也就是说,它不是null).但字符串"你好世界"没有出现.请帮助.谢谢.