Option : HTMLElement
Return to: HTML DOM Level 0 index

Option in a Select list.

Platform Support

IE Mozilla Netscape Opera Chrome Safari
3.0+ 1.0+ 2.0+ no no no

Constructors

Constructor Action IE Mozilla Netscape Opera Chrome Safari
Creates a new instance of an Option object.
Show Details 3.0+ 1.0+ 2.0+ no no no

Option() : Option

Creates a new instance of an Option object.

Returns
Option

Visibility
internal

Properties

Property Action IE Mozilla Netscape Opera Chrome Safari
defaultSelected : Boolean
Whether or not the option is selected by default.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 5.0+ 1.0+
Availability

W3C

index : Number
Index in the options array for the option.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 5.0+ 1.0+
Availability

W3C

selected : Boolean
Whether or not the option is currently selected.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 5.0+ 1.0+
Availability

W3C

text : String
Text for the option.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 5.0+ 1.0+
Availability

W3C

value : String
Value of the option that is sent when the form is submitted.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 5.0+ 1.0+
Availability

W3C

References

Select|Select.options[]|HTMLOptionElement|HTMLSelectElement

Availability

JavaScript 1.0|enhanced in JavaScript 1.1|W3C

text_javascript aptana_docs