blob: 1b832428a963d94f02d1a3d51551693cb0bb8458 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
<html>
<head>
<script>
function log(msg)
{
document.getElementById('console').appendChild(document.createTextNode(msg + '\n'));
}
function test()
{
if (window.testRunner)
testRunner.dumpAsText();
var sl = document.getElementById("sl");
// This checks that the select element's length property is still '1',
// even though there is an option with the same name
if (sl.length == 1)
log("Select Element Test Passed");
else
log("Select Element Test Failed");
// This checks that the option collection's length property is still '1',
// even though there is an option with the same name
if (sl.options.length == 1)
log("Options Collection Test Passed");
else
log("Options Collection Test Failed");
}
</script>
</head>
<body onload="test()">
This tests that the length property is not overriden by having an option with the name 'length'.<br>
<select id="sl"><option value="Length" name="length" /></select>
<pre id="console"></pre>
</body>
</html>
|