OLD | NEW |
| (Empty) |
1 <html> | |
2 <head> | |
3 <script> | |
4 function test() { | |
5 var sl = document.getElementById('sl'); | |
6 sl.focus(); | |
7 document.execCommand("SelectAll"); | |
8 if (!document.getElementById('o1').selected && !document.getElem
entById('o2').selected && !document.getElementById('o3').selected) | |
9 log("Test 1 Passed"); | |
10 else | |
11 log("Test 1 Failed. SelectAll should not change a single-sel
ect list box."); | |
12 | |
13 sl.multiple = true; | |
14 document.execCommand("SelectAll"); | |
15 if (document.getElementById('o1').selected && document.getElemen
tById('o2').selected && document.getElementById('o3').selected) | |
16 log("Test 2 Passed"); | |
17 else | |
18 log("Test 2 Failed. SelectAll should select all items in a m
ulti-select list box."); | |
19 | |
20 sl.multiple = false; | |
21 | |
22 if (window.testRunner) | |
23 testRunner.dumpAsText(); | |
24 } | |
25 | |
26 function log(msg) { | |
27 var res = document.getElementById('res'); | |
28 res.innerHTML = res.innerHTML + msg + "<br>"; | |
29 } | |
30 </script> | |
31 </head> | |
32 <body onload="test()"> | |
33 This tests that select all works on options in a list box.<br> | |
34 <select id="sl" size=5> | |
35 <option id="o1">1 | |
36 <option id="o2">2 | |
37 <option id="o3">3 | |
38 </select> | |
39 <div id="res"></div> | |
40 </body> | |
41 </html> | |
OLD | NEW |