Javascript examples for DOM HTML Element:Option
Get text value from <option> tag
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <select onchange="getme(this)"> <option value="1">dog</option> <option value="2">cat</option> <option value="3">bird</option> </select> <script> function getme(e){//from ww w . j a v a 2 s.co m console.log(e.options[e.selectedIndex].text); } </script> </body> </html>