Select.selectedIndex (Property)

The index of the selected item in a <SELECT> block.


DOM level - 1
JavaScript - 1.0
JScript - 1.0
Internet Explorer - 3.02
Netscape - 2.0
Opera - 3.0
Property/method value type:Number primitive
JavaScript syntax:-mySelect.selectedIndex

This is the index number of the Option object in the options[] collection belonging to the receiving Select object. Note that this index number is only good while the options collection is not modified. Adding new options or deleting options will change the ordering of the collection.

Feedback from several people suggests that in the case of a multiple selection taking place this property returns the index of the first selected item.

See also:Select.multiple, Select.options[]