1 <select id=
"sel1" disabled=
"disabled">
2 <option selected=
"selected">FAIL
</option>
5 <select id=
"sel2" disabled=
"disabled">
6 <option selected=
"selected">FAIL
</option>
11 <option selected=
"selected">FAIL
</option>
12 <option disabled=
"disabled">PASS
</option>
15 <option selected=
"selected">FAIL
</option>
16 <option disabled=
"disabled">PASS
</option>
19 <select id=
"sel5" size=
"2" disabled=
"disabled">
20 <option selected=
"selected">FAIL
</option>
23 <select id=
"sel6" size=
"2" disabled=
"disabled">
24 <option selected=
"selected">FAIL
</option>
28 <select id=
"sel7" size=
"2">
29 <option selected=
"selected">FAIL
</option>
30 <option disabled=
"disabled">PASS
</option>
32 <select id=
"sel8" size=
"2">
33 <option selected=
"selected">FAIL
</option>
34 <option disabled=
"disabled">PASS
</option>
40 var sel1
= document
.getElementById("sel1");
41 sel1
.options
[1].selected
= true;
43 if (sel1
.selectedIndex
== 1)
44 document
.write("PASS: sel1 correctly set to selectedIndex 1 by sel1.options[1].selected = true.<br>");
46 document
.write("FAIL: sel1 set to selectedIndex " + sel1
.selectedIndex
+ " instead of 1 by sel1.options[1].selected = true.<br>");
48 var sel2
= document
.getElementById("sel2");
49 sel2
.selectedIndex
= 1;
51 if (sel2
.selectedIndex
== 1)
52 document
.write("PASS: sel2 correctly set to selectedIndex 1 by sel2.selectedIndex = 1.<br>");
54 document
.write("FAIL: sel2 set to selectedIndex " + sel2
.selectedIndex
+ " instead of 1 by sel2.selectedIndex = 1.<br>");
56 var sel3
= document
.getElementById("sel3");
57 sel3
.options
[1].selected
= true;
59 if (sel3
.selectedIndex
== 1)
60 document
.write("PASS: sel3 correctly set to selectedIndex 1 by sel3.options[1].selected = true.<br>");
62 document
.write("FAIL: sel3 set to selectedIndex " + sel3
.selectedIndex
+ " instead of 1 by sel3.options[1].selected = true.<br>");
64 var sel4
= document
.getElementById("sel4");
65 sel4
.selectedIndex
= 1;
67 if (sel4
.selectedIndex
== 1)
68 document
.write("PASS: sel4 correctly set to selectedIndex 1 by sel4.selectedIndex = 1.<br>");
70 document
.write("FAIL: sel4 set to selectedIndex " + sel4
.selectedIndex
+ " instead of 1 by sel4.selectedIndex = 1.<br>");
73 var sel5
= document
.getElementById("sel5");
74 sel5
.options
[1].selected
= true;
76 if (sel5
.selectedIndex
== 1)
77 document
.write("PASS: sel5 correctly set to selectedIndex 1 by sel5.options[1].selected = true.<br>");
79 document
.write("FAIL: sel5 set to selectedIndex " + sel5
.selectedIndex
+ " instead of 1 by sel5.options[1].selected = true.<br>");
81 var sel6
= document
.getElementById("sel6");
82 sel6
.selectedIndex
= 1;
84 if (sel6
.selectedIndex
== 1)
85 document
.write("PASS: sel6 correctly set to selectedIndex 1 by sel6.selectedIndex = 1.<br>");
87 document
.write("FAIL: sel6 set to selectedIndex " + sel6
.selectedIndex
+ " instead of 1 by sel6.selectedIndex = 1.<br>");
89 var sel7
= document
.getElementById("sel7");
90 sel7
.options
[1].selected
= true;
92 if (sel7
.selectedIndex
== 1)
93 document
.write("PASS: sel7 correctly set to selectedIndex 1 by sel7.options[1].selected = true.<br>");
95 document
.write("FAIL: sel7 set to selectedIndex " + sel7
.selectedIndex
+ " instead of 1 by sel7.options[1].selected = true.<br>");
97 var sel8
= document
.getElementById("sel8");
98 sel8
.selectedIndex
= 1;
100 if (sel8
.selectedIndex
== 1)
101 document
.write("PASS: sel8 correctly set to selectedIndex 1 by sel8.selectedIndex = 1.<br>");
103 document
.write("FAIL: sel8 set to selectedIndex " + sel8
.selectedIndex
+ " instead of 1 by sel8.selectedIndex = 1.<br>");