S
shanti
In Internet Explorer 6, getElementById() can return a form field whose
name (but not id) matches the search. This is erroneous -- an id is
unique in a document, a name is not.
In this example, click on the button. The text "foo bar" should change
to "hello, world". Mozilla executes this document correctly. In IE, the
texatrea changes instead.
<html>
<body>
<form>
<textarea name=choices rows=10 cols=40>
ABCDE
</textarea>
</form>
<script>
var choices = ['1','2','3','4',5];
function test()
{
var x = document.getElementById("choices");
alert(x.innerHTML);
x.innerHTML="hello, world";
}
</script>
<span id=choices>foo bar</span>
<input type=button onClick="test()" value="Test">
</body>
</html>
name (but not id) matches the search. This is erroneous -- an id is
unique in a document, a name is not.
In this example, click on the button. The text "foo bar" should change
to "hello, world". Mozilla executes this document correctly. In IE, the
texatrea changes instead.
<html>
<body>
<form>
<textarea name=choices rows=10 cols=40>
ABCDE
</textarea>
</form>
<script>
var choices = ['1','2','3','4',5];
function test()
{
var x = document.getElementById("choices");
alert(x.innerHTML);
x.innerHTML="hello, world";
}
</script>
<span id=choices>foo bar</span>
<input type=button onClick="test()" value="Test">
</body>
</html>