Javascript examples for DOM HTML Element:Select
Handle <select> option value changed event
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <select id="example"> <option value="1">1st</option> <option value="2">2nd</option> </select> <script type="text/javascript"> document.getElementById("example").onchange = function() { var selected = this.value;/*from w ww .j a v a 2 s .c om*/ console.log(selected); } </script> </body> </html>