Javascript examples for DOM HTML Element:Select
Setting the selected item of a <Select> element
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {/*from www .j a va 2 s . c o m*/ document.getElementById("a").selectedIndex =1 }); </script> </head> <body> <select id="a"> <option value="1">1</option> <option value="2">2</option> </select> </body> </html>