Browser/User Agent Support
| IE | Mozilla | Netscape | Opera | Safari | Netscapte | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
|---|
Constructors
| Constructor | IE | Mozilla | Netscape | Opera | Safari | Netscapte |
|---|---|---|---|---|---|---|
Select element on an HTML form. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
Properties
| Property | IE | Mozilla | Netscape | Opera | Safari | Netscapte |
|---|---|---|---|---|---|---|
If true, indicates that the element is disabled. | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ | no |
The form that contains this element. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
Number of Option elements that this Select element contains. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
If true, indicates that the user can select multiple options. | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ | no |
Name of the Select element. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
Array of HTMLOptionElement objects that this Select element contains. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
Index for the currently selected Option element. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
Number of options to display at a time. | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ | no |
Position of the element in the tabbing order for the document. | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ | no |
If, multiple=true, then the value for type is "select-multiple." Otherwise, "select-one." | 4.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ | no |
Methods
| Method | IE | Mozilla | Netscape | Opera | Safari | Netscapte |
|---|---|---|---|---|---|---|
Adds the specified option element to the options array at the specified position. | 5.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ | no |
Removes focus from the element. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
Gives the element focus. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | no |
Removes the option at the specified index position. | 5.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ | no |
References
HTMLFormElement | HTMLOptionElement | Option | Select
Availability
HTML DOM Level 1 | HTML DOM Level 2 | W3C
Constructor Detail
Property Detail
Boolean disabled
If true, indicates that the element is disabled.
-
For examples, see the quirksmode test page:
- Availability
HTML DOM Level 1 | HTML DOM Level 2 | W3C
HTMLFormElement form - read only
The form that contains this element.
- Availability
HTML DOM Level 1 | HTML DOM Level 2 | W3C
Number length - read only
Number of Option elements that this Select element contains.
- Availability
HTML DOM Level 1 | HTML DOM Level 2 | W3C
Boolean multiple
If true, indicates that the user can select multiple options.
- Availability
HTML DOM Level 1 | HTML DOM Level 2 | W3C
String name
Name of the Select element.
-
For examples, see the quirksmode test page:
- Availability
HTML DOM Level 1 | HTML DOM Level 2 | W3C
HTMLCollection options - read only
Array of HTMLOptionElement objects that this Select element contains.
- Availability
HTML DOM Level 1 | HTML DOM Level 2 | W3C
Number selectedIndex
Index for the currently selected Option element.
- Availability
HTML DOM Level 1 | HTML DOM Level 2 | W3C
Number size
Number of options to display at a time.
- Availability
HTML DOM Level 1 | HTML DOM Level 2 | W3C
Number tabIndex
Position of the element in the tabbing order for the document.
- Availability
HTML DOM Level 1 | HTML DOM Level 2 | W3C
String type - read only
If, multiple=true, then the value for type is "select-multiple." Otherwise, "select-one."
- Availability
HTML DOM Level 1 | HTML DOM Level 2 | W3C
Method Detail
add(HTMLElement element, HTMLElement before) : void
Adds the specified option element to the options array at the specified position.
| HTMLElement | element | Option element to add. |
| HTMLElement | before | Option element to add the new element before. |
-
For examples, see the quirksmode test page:
- See Also
- Availability
HTML DOM Level 1 | HTML DOM Level 2 | W3C
blur() : void
Removes focus from the element.
- Availability
HTML DOM Level 1 | HTML DOM Level 2 | W3C
focus() : void
Gives the element focus.
- Availability
HTML DOM Level 1 | HTML DOM Level 2 | W3C
remove(Number index) : void
Removes the option at the specified index position.
| Number | index | Index of the option element to remove. |
-
For examples, see the quirksmode test page:
- See Also
- Availability
HTML DOM Level 1 | HTML DOM Level 2 | W3C
