| OLD | NEW |
| (Empty) |
| 1 <html > | |
| 2 <body> | |
| 3 <p>This tests that we can find the selected value of a dropdown when this format
is used: [select_name][this.selectedIndex].value. | |
| 4 See bug 798404. </p> | |
| 5 | |
| 6 <script> | |
| 7 if (window.testRunner) | |
| 8 testRunner.dumpAsText(); | |
| 9 | |
| 10 function test(selected_value) { | |
| 11 if (selected_value == 'C') { | |
| 12 document.getElementById("sourceViewDiv").innerHTML=' This test: PASSED!'; | |
| 13 } | |
| 14 } | |
| 15 </script> | |
| 16 | |
| 17 <form> | |
| 18 | |
| 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> | |
| 23 </select> | |
| 24 | |
| 25 <div id='sourceViewDiv'>This test: FAILED</div> | |
| 26 | |
| 27 <script> | |
| 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); | |
| 32 x.dispatchEvent(evt); | |
| 33 </script> | |
| 34 | |
| 35 </form> | |
| 36 | |
| 37 | |
| 38 </body> | |
| 39 </html> | |
| OLD | NEW |