Easy Tutorial
❮ Prop Style Minwidth Met Tablerow Deletecell ❯

HTML DOM


Select Object

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

Each time the <select> tag appears in an HTML form, a Select object is created.

You can access a Select object by traversing 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 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 Attributes and Events

The Select object also supports standard attributes and events.

❮ Prop Style Minwidth Met Tablerow Deletecell ❯