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 | ||
|---|---|---|---|---|---|---|---|---|
|
HTMLSelectElement Constructor() : HTMLSelectElement
Select element on an HTML form.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | ||
HTMLSelectElement() : HTMLSelectElementSelect element on an HTML form. Returns
|
||||||||
Properties
| Property | Action | IE | Mozilla | Netscape | Opera | Safari |
|---|---|---|---|---|---|---|
|
disabled
: Boolean
If true, indicates that the element 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+ |
|
||||||
|
length
: Number
Number of Option elements that this Select element contains.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
|
multiple
: Boolean
If true, indicates that the user can select multiple options.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ |
|
||||||
|
name
: String
Name of the Select element.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
|
options
: HTMLCollection
Array of HTMLOptionElement objects that this Select element contains.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
|
selectedIndex
: Number
Index for the currently selected Option element.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
|
size
: Number
Number of options to display at a time.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ |
|
||||||
|
tabIndex
: Number
Position of the element in the tabbing order for the document.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ |
|
||||||
|
type
: String
If, multiple=true, then the value for type is "select-multiple." Otherwise, "select-one."
|
Show Details | 4.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ |
|
||||||
Functions
| Method | Action | IE | Mozilla | Netscape | Opera | Safari | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
add(HTMLElement element, HTMLElement before) : void
Adds the specified option element to the options array at the specified position.
|
Show Details | 5.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ | ||||||||
|
Parameters
Returns
|
||||||||||||||
|
blur() : void
Removes focus from the element.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | ||||||||
|
Returns
|
||||||||||||||
|
focus() : void
Gives the element focus.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | ||||||||
|
Returns
|
||||||||||||||
|
remove(Number index) : void
Removes the option at the specified index position.
|
Show Details | 5.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ | ||||||||
|
Parameters
Returns
|
||||||||||||||
References
HTMLFormElement|HTMLOptionElement|Option|Select
Availability
HTML DOM Level 1|HTML DOM Level 2|W3C
