| OLD | NEW |
| (Empty) |
| 1 <?xml version="1.0"?> | |
| 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN" "http://www.w3.org/TR/xh
tml-basic/xhtml-basic10.dtd"> | |
| 3 <html xmlns="http://www.w3.org/1999/xhtml"> | |
| 4 <head> | |
| 5 <script> | |
| 6 function print(message) | |
| 7 { | |
| 8 var paragraph = document.createElement("li"); | |
| 9 paragraph.appendChild(document.createTextNode(message)); | |
| 10 document.getElementById("console").appendChild(paragraph); | |
| 11 } | |
| 12 function test() | |
| 13 { | |
| 14 if (window.testRunner) | |
| 15 testRunner.dumpAsText(); | |
| 16 selectElement = document.getElementById("select1"); | |
| 17 if (selectElement.value == "3") | |
| 18 print("LOAD:SUCCEEDED!"); | |
| 19 else | |
| 20 print("LOAD:FAILED: Expected '3' found " + selectElement.value); | |
| 21 selectElement.getElementsByTagName("option").item(1).selected=true; | |
| 22 if (selectElement.value == "2") | |
| 23 print("SELECT:SUCCEEDED!"); | |
| 24 else | |
| 25 print("SELECT:FAILED: Expected '2' found " + selectElement.value); | |
| 26 document.getElementById("reset1").click(); | |
| 27 if (selectElement.value == "3") | |
| 28 print("RESET:SUCCEEDED!"); | |
| 29 else | |
| 30 print("RESET:FAILED: Expected '3' found " + selectElement.value); | |
| 31 } | |
| 32 </script> | |
| 33 </head> | |
| 34 <body onload="test()"> | |
| 35 <p>This test checks to see what happens if we mark 2 items as selected in a sing
le selection select element.</p> | |
| 36 <p>If The test succeeds one should see 3 lines below the ruller below each conta
ining the word SUCCEEDED in it.</p> | |
| 37 <form id="form1" method="post" action="form_resp.asp"> | |
| 38 <select name="Select" size="2" id="select1"> | |
| 39 <option selected="selected">1</option> | |
| 40 <option>2</option> | |
| 41 <option selected="selected">3</option> | |
| 42 | |
| 43 <option>4</option> | |
| 44 </select> | |
| 45 <input type="reset" name="reset" value="Reset 1" id="reset1"/><br/> | |
| 46 <hr> | |
| 47 <p><ol id=console></ol></p> | |
| 48 </form></body></html> | |
| OLD | NEW |