Option index Property
Option Object
Definition and Usage
The index property returns the index position of the option in the dropdown list.
The index starts at 0.
Syntax
Set the index property:
optionObject.index=
integer
Return the index property:
optionObject.index
Browser support





All major browsers support the index property
Example
Example
This example returns the index position of the selected option in the dropdown list:
Try it »
Option Object