HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

selectedIndex

Description

The selectedIndex of HTMLOptionsCollection for JS returns the index of the first selected item, if any, or −1 if there is no selected item.

Changes the selection to the option element at index index in collection.

Syntax

collection.selectedIndex
collection.selectedIndex = index

Parameters

index

The number of preceding siblings, or 0 if it has none.

Examples

1 · get · first

2 · get · none

3 · set · single

4 · set · multiple