Name
index — NN 2 IE 3 DOM n/a
Synopsis
Read-only
Returns the zero-based index value of the current option object
within the collection of options of the SELECT
element. The select object’s selectedIndex
property returns the index value of the option that is currently
selected. Since you usually access an OPTION
object via its place in the options
array, there
is little need to reference this property.
Example
var firstValue = document.forms[0].stateList.options[0].index
Value
Integer.
Default
None.
Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.