开发者

inner DIV not accessible using document.getElementById

see below html

<Div id="one">
 <Div id="two">

 <开发者_如何学C;/Div>
</Div>

when i am accessing div "two" with "document.getElementById("two")...am getting null.


It worked for me.

<body onload="javascript:test();">
<Div id="one">
 <Div id="two">

 </Div>
</Div>


function test()
{
alert(document.getElementById("two"));
}

and I receive a messagebox which displays

[object]

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜