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 | ||
|---|---|---|---|---|---|---|---|---|---|
|
HTMLSelectElement Constructor() : HTMLSelectElement
Select element on an HTML form.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no | ||
HTMLSelectElement() : HTMLSelectElementSelect element on an HTML form. Returns
|
|||||||||
Properties
| Property | Action | IE | Mozilla | Netscape | Opera | Safari | Chrome |
|---|---|---|---|---|---|---|---|
|
disabled
: Boolean
If true, indicates that the element 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 |
|
|||||||
|
length
: Number
Number of Option elements that this Select element contains.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
multiple
: Boolean
If true, indicates that the user can select multiple options.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
name
: String
Name of the Select element.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
options
: HTMLCollection
Array of HTMLOptionElement objects that this Select element contains.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
selectedIndex
: Number
Index for the currently selected Option element.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
size
: Number
Number of options to display at a time.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ | no |
|
|||||||
|
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+ | no |
|
|||||||
|
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+ | no |
|
|||||||
Functions
| Method | Action | IE | Mozilla | Netscape | Opera | Safari | Chrome | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
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+ | no | ||||||||
|
Parameters
Returns
|
|||||||||||||||
|
blur() : void
Removes focus from the element.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no | ||||||||
|
Returns
|
|||||||||||||||
|
focus() : void
Gives the element focus.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no | ||||||||
|
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+ | no | ||||||||
|
Parameters
Returns
|
|||||||||||||||
References
HTMLFormElement|HTMLOptionElement|Option|Select
Availability
HTML DOM Level 1|HTML DOM Level 2|W3C