HTMLSelectElement : HTMLElement
Return to: HTML DOM Level 2 index

Select 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
HTMLSelectElement Constructor() : HTMLSelectElement
Select element on an HTML form.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no

HTMLSelectElement() : HTMLSelectElement

Select element on an HTML form.

Returns
HTMLSelectElement

Visibility
internal

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

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/stylesheets.html

Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

form : HTMLFormElement
The form that contains this element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

length : Number
Number of Option elements that this Select element contains.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

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
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

name : String
Name of the Select element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/attributes.html

Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

options : HTMLCollection
Array of HTMLOptionElement objects that this Select element contains.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

selectedIndex : Number
Index for the currently selected Option element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

size : Number
Number of options to display at a time.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+ no
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

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
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

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
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

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
HTMLElement element Option element to add.
HTMLElement before Option element to add the new element before.

Returns
void

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/add.html

See Also

Select

Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

blur() : void
Removes focus from the element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no

Returns
void

Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

focus() : void
Gives the element focus.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no

Returns
void

Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

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
Number index Index of the option element to remove.

Returns
void

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/add.html

See Also

Select

Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

References

HTMLFormElement|HTMLOptionElement|Option|Select

Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

text_javascript aptana_docs