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