4 function print(message
, color
)
6 var paragraph
= document
.createElement("div");
7 paragraph
.appendChild(document
.createTextNode(message
));
8 paragraph
.style
.fontFamily
= "monospace";
10 paragraph
.style
.color
= color
;
11 document
.getElementById("console").appendChild(paragraph
);
17 var selects
= document
.getElementsByTagName('select');
18 for (var i
= 0; i
< selects
.length
; i
++) { // >
20 var item
= document
.getElementsByTagName('select')[i
].namedItem('name1');
22 print("FOUND ITEM: " + item
.innerHTML
);
24 print("NO ITEM: namedItem returned" + item
);
26 print("ERROR: " + e
.message
);
29 if (window
.testRunner
)
30 testRunner
.dumpAsText();
33 <title>Test for HTMLSelectElement.namedItem()
</title>
36 <body onload=
"test();">
40 <H3>Test for HTMLSelectElement.namedItem()
</H3>
43 <div style=
"visibility: hidden">
45 <option name=
"name1">1</option>
46 <option id=
"name1">2</option>
50 <option id=
"name1">1</option>
51 <option name=
"name1">2</option>
55 <option name=
"name1">1</option>
56 <option name=
"name1">2</option>
60 <option id=
"name1">1</option>
61 <option id=
"name1">2</option>
65 <option id=
"name2">1</option>
66 <option id=
"name3">2</option>