OLD | NEW |
| (Empty) |
1 <html> | |
2 <head> | |
3 <script> | |
4 function print(message, color) | |
5 { | |
6 var paragraph = document.createElement("div"); | |
7 paragraph.appendChild(document.createTextNode(message)); | |
8 paragraph.style.fontFamily = "monospace"; | |
9 if (color) | |
10 paragraph.style.color = color; | |
11 document.getElementById("console").appendChild(paragraph); | |
12 } | |
13 | |
14 function test() | |
15 { | |
16 | |
17 var selects = document.getElementsByTagName('select'); | |
18 for (var i = 0; i < selects.length; i++) { // > | |
19 try { | |
20 var item = document.getElementsByTagName('select')[i].namedItem('nam
e1'); | |
21 if (item.innerHTML) | |
22 print("FOUND ITEM: " + item.innerHTML); | |
23 else | |
24 print("NO ITEM: namedItem returned" + item); | |
25 } catch (e) { | |
26 print("ERROR: " + e.message); | |
27 } | |
28 } | |
29 if (window.testRunner) | |
30 testRunner.dumpAsText(); | |
31 } | |
32 </script> | |
33 <title>Test for HTMLSelectElement.namedItem()</title> | |
34 </head> | |
35 | |
36 <body onload="test();"> | |
37 | |
38 <hr> | |
39 <div id='console'> | |
40 <H3>Test for HTMLSelectElement.namedItem()</H3> | |
41 </div> | |
42 | |
43 <div style="visibility: hidden"> | |
44 <select> | |
45 <option name="name1">1</option> | |
46 <option id="name1">2</option> | |
47 </select> | |
48 | |
49 <select> | |
50 <option id="name1">1</option> | |
51 <option name="name1">2</option> | |
52 </select> | |
53 | |
54 <select> | |
55 <option name="name1">1</option> | |
56 <option name="name1">2</option> | |
57 </select> | |
58 | |
59 <select> | |
60 <option id="name1">1</option> | |
61 <option id="name1">2</option> | |
62 </select> | |
63 | |
64 <select name="name1"> | |
65 <option id="name2">1</option> | |
66 <option id="name3">2</option> | |
67 </select> | |
68 | |
69 </div> | |
70 | |
71 </body> | |
72 </html> | |
OLD | NEW |