Option in a Select list.
Browser/User Agent Support
| IE | Mozilla | Netscape | Opera | Safari | 3.0+ | 1.0+ | 2.0+ | no | no |
|---|
Constructors
| Constructor | IE | Mozilla | Netscape | Opera | Safari |
|---|---|---|---|---|---|
Creates a new instance of an Option object. | 3.0+ | 1.0+ | 2.0+ | no | no |
Properties
| Property | IE | Mozilla | Netscape | Opera | Safari |
|---|---|---|---|---|---|
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
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
