Javascript examples for DOM HTML Element:Option
accessing options of a select list
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> // w w w .jav a 2 s.c o m <title>Challenge Question</title> <form action="get"> <select name="questions"> <option value="pet" name="pet">What is your pet's name?</option> </select> </form> <!-- HTML5 style --> <script type="text/javascript"> console.log(document.forms[0].questions.options['pet']); </script> </body> </html>