OLD | NEW |
1 <!-- | |
2 @MAC-DENY:AXLayoutComplete* | |
3 --> | |
4 <!DOCTYPE html> | 1 <!DOCTYPE html> |
5 <html> | 2 <html> |
6 <body> | 3 <body> |
7 <select> | 4 <select> |
8 <option selected>Apple</option> | 5 <option selected>Apple</option> |
9 <option>Orange</option> | 6 <option>Orange</option> |
10 <option>Banana</option> | 7 <option>Banana</option> |
11 </select> | 8 </select> |
12 <script> | 9 <script> |
13 var comboBox = document.querySelector('select'); | 10 var comboBox = document.querySelector('select'); |
14 comboBox.focus(); | 11 comboBox.focus(); |
15 // Expand the combo box. | 12 // Expand the combo box. |
16 var clickEvent = document.createEvent('MouseEvents'); | 13 var clickEvent = document.createEvent('MouseEvents'); |
17 clickEvent.initMouseEvent('mousedown', true, true, window); | 14 clickEvent.initMouseEvent('mousedown', true, true, window); |
18 comboBox.dispatchEvent(clickEvent); | 15 comboBox.dispatchEvent(clickEvent); |
19 function go() { | 16 function go() { |
20 document.querySelector('select').selectedIndex = 1; | 17 document.querySelector('select').selectedIndex = 1; |
21 } | 18 } |
22 </script> | 19 </script> |
23 </body> | 20 </body> |
24 </html> | 21 </html> |
OLD | NEW |