options is an array property of the Javascript select object. The options array define the options of the select box with indices starting from zero.
To grab the value* or text** of a option in the select box, you must know it’s index. Most of the time you’ll only need use of the user selected option, so we can use the select object’s selectedIndex property to get the index we want, then use that to get the value of the option we want. This code example will grab the selected value of the myselect select box:
1 | myselect.options[myselect.selectedIndex].value |
This is an select box:
1 2 3 4 5 | <select onchange="window.location=this.options[this.selectedIndex].value"> <option value="#">Select a search engine</option> <option value="http://www.google.com">Google</option> <option value="http://www.yahoo.com">Yahoo</option> </select> |


