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