OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <style> | 2 <style> |
3 select { | 3 select { |
4 position:absolute; | 4 position:absolute; |
5 top:9px; | 5 top:9px; |
6 left:9px; | 6 left:9px; |
7 height:25px; | 7 height:25px; |
8 width:80px; | 8 width:80px; |
9 } | 9 } |
10 </style> | 10 </style> |
| 11 <script> |
| 12 |
| 13 function openSelectMenu(target) { |
| 14 var evt = document.createEvent("MouseEvents"); |
| 15 evt.initMouseEvent("mousedown", true, true, window); |
| 16 document.querySelector('select').dispatchEvent(evt); |
| 17 } |
| 18 |
| 19 </script> |
11 <html> | 20 <html> |
12 <body> | 21 <body> |
13 <select> | 22 <select> |
14 <option selected>Apple</option> | 23 <option selected>Apple</option> |
15 <option>Orange</option> | 24 <option>Orange</option> |
16 <option>Banana</option> | 25 <option>Banana</option> |
17 </select> | 26 </select> |
18 </body> | 27 </body> |
19 </html> | 28 </html> |
OLD | NEW |