DOM select elements share all of the properties and methods of other HTML elements described in the element
section. They also have the specialized interface HTMLSelectElement (or
HTML 4HTMLSelectElement).

Reflects the
autofocus
HTML attribute, which indicates whether the control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. Only one form-associated element in a document can have this attribute specified.
HTML5Requires Gecko 2.0

The form that this element is associated with. If this element is a descendant of a form element, then this attribute is the ID of that form element. If the element is not a descendant of a form element, then:

HTML5 The attribute can be the ID of any form element in the same document.

A localized message that describes the validation constraints that the control does not satisfy (if any). This attribute is the empty string if the control is not a candidate for constraint validation (willValidate is false), or it satisfies its constraints.Read only.HTML5Requires Gecko 2.0

HTML5 Checks whether the element has any constraints and whether it satisfies them. If the element fails its constraints, the browser fires a cancelable invalid event at the element (and returns false).

Return value

A false value if the select element is a candidate for constraint evaluation and it does not satisfy its constraints. Returns true if the element is not constrained, or if it satisfies its constraints.

HTML5 Gets an item from the options collection for this select element. You can also access an item by specifying the index in array-style brackets or parentheses, without calling this method explicitly.

Parameters

index

The zero-based index into the collection of the option to get.

Return value

The node at the specified index, or null if such a node does not exist in the collection.

HTML5 Gets the item in the options collection with the specified name. The name string can match either the id or the name attribute of an option node. You can also access an item by specifying the name in array-style brackets or parentheses, without calling this method explicitly.

Parameters

name

The name of the option to get.

Return value

A node, if there is exactly one match.

null if there are no matches.

A NodeList
in tree order of nodes whose name or id attributes match the specified name.