OLD | NEW |
| (Empty) |
1 <html> | |
2 <body> | |
3 <p>This tests that a locally scoped variable in an event handler of a form | |
4 takes precedence over items of form. | |
5 | |
6 <form> | |
7 <select onChange="var value = this.value;this.options[0].selected=true; if(value
=='C') document.getElementById('sourceViewDiv').innerHTML='This test: PASSED!'"> | |
8 <option value="A">A</option> | |
9 <option value="B">B</option> | |
10 <option value="C">C</option> | |
11 </select> | |
12 | |
13 <div id='sourceViewDiv'>This test: FAILED</div> | |
14 | |
15 <script> | |
16 if (window.layoutTestController) | |
17 layoutTestController.dumpAsText(); | |
18 | |
19 var x=document.getElementsByTagName('select')[0]; | |
20 x.options[2].selected=true; | |
21 var evt = document.createEvent("HTMLEvents"); | |
22 evt.initEvent("change", true, true); | |
23 x.dispatchEvent(evt); | |
24 </script> | |
25 </form> | |
26 | |
27 </body> | |
28 </html> | |
OLD | NEW |