D
datvong
On Internet Explorer 7, getElementById does not work if I have an
iframe in my html.
<html>
<script language="Javascript">
function Init()
{
var win = document.getElementById("0");
alert(win);
}
</script>
<body onLoad="Init();">
<iframe />
<div id="0"> Hello World</div>
</body>
</html>
In this case, win is NULL. However, if I move the iframe BELOW the
div, then it works fine. Weird.
iframe in my html.
<html>
<script language="Javascript">
function Init()
{
var win = document.getElementById("0");
alert(win);
}
</script>
<body onLoad="Init();">
<iframe />
<div id="0"> Hello World</div>
</body>
</html>
In this case, win is NULL. However, if I move the iframe BELOW the
div, then it works fine. Weird.