Option element on an HTML form.
Platform Support
| IE | Mozilla | Netscape | Opera | Safari | Chrome | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
|---|
Constructors
| Constructor | Action | IE | Mozilla | Netscape | Opera | Safari | Chrome | ||
|---|---|---|---|---|---|---|---|---|---|
|
HTMLOptionElement Constructor() : HTMLOptionElement
Option element on an HTML form.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no | ||
HTMLOptionElement() : HTMLOptionElementOption element on an HTML form. Returns
|
|||||||||
Properties
| Property | Action | IE | Mozilla | Netscape | Opera | Safari | Chrome |
|---|---|---|---|---|---|---|---|
|
defaultSelected
: Boolean
If true, indicates that the option is selected by default.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
disabled
: Boolean
If true, indicates that the option is disabled.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
form
: HTMLFormElement
The form that contains this element.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
index
: Number
Index of the element within its parent Select element.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
label
: String
Text label for the element.
|
Show Details | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
selected
: Boolean
If true, indicates that the element is selected.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
text
: String
Text label for the option element.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
value
: String
Value for the element that is sent to the server when the form is submitted.
|
Show Details | 4.0+ | 1.0+ | 4.0+ | 7.0+ | 1.0+ | no |
|
|||||||
References
HTMLFormElement|HTMLInputElement|HTMLSelectElement|Option|Select
Availability
HTML DOM Level 1|HTML DOM Level 2|W3C