3 <p>This tests that we can find the selected value of a dropdown when this format is used: [select_name][this.selectedIndex].value.
8 testRunner
.dumpAsText();
10 function test(selected_value
) {
11 if (selected_value
== 'C') {
12 document
.getElementById("sourceViewDiv").innerHTML
=' This test: PASSED!';
19 <select name=
"URL" onChange=
"javascript:test(URL[this.selectedIndex].value);" >
20 <option value=
"A">A
</option>
21 <option value=
"B">B
</option>
22 <option value=
"C">C
</option>
25 <div id='sourceViewDiv'
>This test: FAILED
</div>
28 var x
=document
.getElementsByTagName('select')[0];
29 x
.options
[2].selected
=true;
30 var evt
= document
.createEvent("HTMLEvents");
31 evt
.initEvent("change", true, true);