OLD | NEW |
| (Empty) |
1 <head> | |
2 <script> | |
3 function test() | |
4 { | |
5 if (window.testRunner) | |
6 testRunner.dumpAsText(); | |
7 var select = document.getElementById('select'); | |
8 var index = select.selectedIndex; | |
9 document.forms[0].reset(); | |
10 var message = "selected index is " + index + " before and " + select.selecte
dIndex + " after reset()."; | |
11 var paragraph = document.createElement('p'); | |
12 paragraph.appendChild(document.createTextNode(message)); | |
13 document.getElementById('console').appendChild(paragraph); | |
14 } | |
15 </script> | |
16 </head> | |
17 <body onload="test();"> | |
18 <p>This tests reseting of a select box with no selected options using JavaScript
. If successful, both times the selected index should be 0.<form> | |
19 <form> | |
20 <select id="select"> | |
21 <option>Option 0</option> | |
22 <option>Option 1</option> | |
23 <option>Option 2</option> | |
24 </select> | |
25 </form> | |
26 <p id="console"></p> | |
27 </body> | |
OLD | NEW |