index property (optgroup, option)
Specifies or returns an integer that indicates the position of an option element within a selection list.
The position of an option in a selection list and in the options collection of the selection list is identical.
You can find the related objects in the Supported by objects section below.
This property is read/write.
Zero-based integer that sets or retrieves the ordinal position.
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the index property:
Did you find this example helpful?
User Contributed Comments