Select selectedIndex Property
Select object
Definition and Usage
The selectedIndex property sets or returns the index of the selected option in the drop-down list.
Note: If multiple selections are allowed, only the index of the first selected option is returned.
Syntax
Set the selectedIndex property:
selectObject.selectedIndex=
integer
Return the selectedIndex property:
selectObject.selectedIndex
Browser support





All major browsers support the selectedIndex property
Example
Example
The following example displays the index of the selected option:
Try it »
Select object