IE treats the id and name attributes of elements equally when using document.getElementById().
For an example, use the following HTML code.
<html>
<body>
name: testMe
<input type="text" name="testMe" value="First Element" /><br />
name: dontTestMe id: testMe
<input type="text" name="dontTestMe" id="testMe" value="Second Element" />
<br />
<input type="button" onclick="alert(document.getElementById('testMe').value);" value="Click me to see what happens." " />
</body>
</html>
Working Example
name: testMe
name: dontTestMe id: testMe
No comments:
Post a Comment