106 lines
3.6 KiB
HTML
106 lines
3.6 KiB
HTML
<select id="sel1" disabled="disabled">
|
|
<option selected="selected">FAIL</option>
|
|
<option>PASS</option>
|
|
</select><br>
|
|
<select id="sel2" disabled="disabled">
|
|
<option selected="selected">FAIL</option>
|
|
<option>PASS</option>
|
|
</select><br>
|
|
|
|
<select id="sel3">
|
|
<option selected="selected">FAIL</option>
|
|
<option disabled="disabled">PASS</option>
|
|
</select><br>
|
|
<select id="sel4">
|
|
<option selected="selected">FAIL</option>
|
|
<option disabled="disabled">PASS</option>
|
|
</select><br>
|
|
|
|
<select id="sel5" size="2" disabled="disabled">
|
|
<option selected="selected">FAIL</option>
|
|
<option>PASS</option>
|
|
</select><br>
|
|
<select id="sel6" size="2" disabled="disabled">
|
|
<option selected="selected">FAIL</option>
|
|
<option>PASS</option>
|
|
</select><br>
|
|
|
|
<select id="sel7" size="2">
|
|
<option selected="selected">FAIL</option>
|
|
<option disabled="disabled">PASS</option>
|
|
</select><br>
|
|
<select id="sel8" size="2">
|
|
<option selected="selected">FAIL</option>
|
|
<option disabled="disabled">PASS</option>
|
|
</select><br>
|
|
|
|
|
|
<script>
|
|
|
|
var sel1 = document.getElementById("sel1");
|
|
sel1.options[1].selected = true;
|
|
|
|
if (sel1.selectedIndex == 1)
|
|
document.write("PASS: sel1 correctly set to selectedIndex 1 by sel1.options[1].selected = true.<br>");
|
|
else
|
|
document.write("FAIL: sel1 set to selectedIndex " + sel1.selectedIndex + " instead of 1 by sel1.options[1].selected = true.<br>");
|
|
|
|
var sel2 = document.getElementById("sel2");
|
|
sel2.selectedIndex = 1;
|
|
|
|
if (sel2.selectedIndex == 1)
|
|
document.write("PASS: sel2 correctly set to selectedIndex 1 by sel2.selectedIndex = 1.<br>");
|
|
else
|
|
document.write("FAIL: sel2 set to selectedIndex " + sel2.selectedIndex + " instead of 1 by sel2.selectedIndex = 1.<br>");
|
|
|
|
var sel3 = document.getElementById("sel3");
|
|
sel3.options[1].selected = true;
|
|
|
|
if (sel3.selectedIndex == 1)
|
|
document.write("PASS: sel3 correctly set to selectedIndex 1 by sel3.options[1].selected = true.<br>");
|
|
else
|
|
document.write("FAIL: sel3 set to selectedIndex " + sel3.selectedIndex + " instead of 1 by sel3.options[1].selected = true.<br>");
|
|
|
|
var sel4 = document.getElementById("sel4");
|
|
sel4.selectedIndex = 1;
|
|
|
|
if (sel4.selectedIndex == 1)
|
|
document.write("PASS: sel4 correctly set to selectedIndex 1 by sel4.selectedIndex = 1.<br>");
|
|
else
|
|
document.write("FAIL: sel4 set to selectedIndex " + sel4.selectedIndex + " instead of 1 by sel4.selectedIndex = 1.<br>");
|
|
|
|
|
|
var sel5 = document.getElementById("sel5");
|
|
sel5.options[1].selected = true;
|
|
|
|
if (sel5.selectedIndex == 1)
|
|
document.write("PASS: sel5 correctly set to selectedIndex 1 by sel5.options[1].selected = true.<br>");
|
|
else
|
|
document.write("FAIL: sel5 set to selectedIndex " + sel5.selectedIndex + " instead of 1 by sel5.options[1].selected = true.<br>");
|
|
|
|
var sel6 = document.getElementById("sel6");
|
|
sel6.selectedIndex = 1;
|
|
|
|
if (sel6.selectedIndex == 1)
|
|
document.write("PASS: sel6 correctly set to selectedIndex 1 by sel6.selectedIndex = 1.<br>");
|
|
else
|
|
document.write("FAIL: sel6 set to selectedIndex " + sel6.selectedIndex + " instead of 1 by sel6.selectedIndex = 1.<br>");
|
|
|
|
var sel7 = document.getElementById("sel7");
|
|
sel7.options[1].selected = true;
|
|
|
|
if (sel7.selectedIndex == 1)
|
|
document.write("PASS: sel7 correctly set to selectedIndex 1 by sel7.options[1].selected = true.<br>");
|
|
else
|
|
document.write("FAIL: sel7 set to selectedIndex " + sel7.selectedIndex + " instead of 1 by sel7.options[1].selected = true.<br>");
|
|
|
|
var sel8 = document.getElementById("sel8");
|
|
sel8.selectedIndex = 1;
|
|
|
|
if (sel8.selectedIndex == 1)
|
|
document.write("PASS: sel8 correctly set to selectedIndex 1 by sel8.selectedIndex = 1.<br>");
|
|
else
|
|
document.write("FAIL: sel8 set to selectedIndex " + sel8.selectedIndex + " instead of 1 by sel8.selectedIndex = 1.<br>");
|
|
|
|
</script>
|