ListBox.SelectedIndex

Syntax

SelectedIndex: Number

Description

The SelectedIndex property determines index of the selected list row.

Comments

By default no row is selected on creating the ListBox component, and the property returns the index -1.

Example

To execute the example create the ListBox component (see Example of Creating the ListBox Component). Use the SelectedIndex property to select the first list element when placing it on the HTML page.

SelectedIndex: 0

 

After executing the example the list with the highlighted first element is located on the HTML page.

See also:

ListBox