HTML DOM SelectObject


Select Object

The Select object represents a drop-down list in an HTML form.

In an HTML form, a Select object is created each time a <select> tag appears.

You can access a Select object by iterating through the form's elements[] array, or by using document.getElementById().


Select Object Collections

W3C:W3C Standard.

Collection Description W3C
options Returns an array containing all the options in the drop-down list. Yes

Select Object Properties

Property Description W3C
disabled Sets or returns whether the drop-down list should be disabled. Yes
form Returns a reference to the form that contains the drop-down list. Yes
length Returns the number of options in the drop-down list. Yes
multiple Sets or returns whether multiple items can be selected. Yes
name Sets or returns the name of the drop-down list. Yes
selectedIndex Sets or returns the index number of the selected item in the drop-down list. Yes
size Sets or returns the number of visible rows in the drop-down list. Yes
type Returns the form type of the drop-down list. Yes

Select Object Methods

Method Description W3C
add() Adds an option to the drop-down list. Yes
remove() Removes an option from the drop-down list. Yes

Standard Properties and Events

The Select object also supports standardpropertiesandevents。

Other Extensions