Javascript examples for DOM HTML Element:Option
getting the <select> option value
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from w w w . jav a 2s .c o m*/ var select = document.getElementById('tdd'); if (select){ console.log(tdd.value); } } </script> </head> <body> <select id="tdd"> <option val="1">Option 1</option> <option val="2">Option 2</option> <option val="3" selected>Option 3</option> </select> </body> </html>