Option : HTMLElement

Option in a Select list.

Browser/User Agent Support

IEMozillaNetscapeOperaSafari
3.0+1.0+2.0+nono

Constructors

ConstructorIEMozillaNetscapeOperaSafari
Creates a new instance of an Option object.
3.0+1.0+2.0+nono
 

Properties

PropertyIEMozillaNetscapeOperaSafari
Whether or not the option is selected by default.
3.0+1.0+2.0+7.0+1.0+
 
Index in the options array for the option.
3.0+1.0+2.0+7.0+1.0+
 
Whether or not the option is currently selected.
3.0+1.0+2.0+7.0+1.0+
 
Text for the option.
3.0+1.0+2.0+7.0+1.0+
 
Value of the option that is sent when the form is submitted.
3.0+1.0+2.0+7.0+1.0+
 

References

Select | Select.options[] | HTMLOptionElement | HTMLSelectElement

Availability

JavaScript 1.0 | enhanced in JavaScript 1.1 | W3C

Constructor Detail

Option Option()

Creates a new instance of an Option object.

Visibility
internal

Property Detail

Boolean defaultSelected

Whether or not the option is selected by default.

Availability

W3C

Number index

Index in the options array for the option.

Availability

W3C

Boolean selected

Whether or not the option is currently selected.

Availability

W3C

String text

Text for the option.

Availability

W3C

String value

Value of the option that is sent when the form is submitted.

Availability

W3C