Easy Tutorial
❮ Prop Style Fontfamily Prop Password Disabled ❯

Select selectedIndex Property


Definition and Usage

The selectedIndex property sets or returns the index of the selected option in a dropdown list.

Note: If multiple selections are allowed, only the index of the first selected option will be returned.

Syntax

Set the selectedIndex property:

Return the selectedIndex property:


Browser Support

All major browsers support the selectedIndex property.


Example

The following example will prompt the index of the selected option:

❮ Prop Style Fontfamily Prop Password Disabled ❯