Object: HTMLSelectElement
HTMLSelectElement properties
Property name |
Type |
Description |
Status |
Availability |
|---|---|---|---|---|
disabled |
boolean |
When true, indicates that the form control is not available. |
writable |
4.6 or later |
form |
Returns the form that contains the form control. If this element is not contained by a form, this property returns null. |
read only |
4.6 or later |
|
length |
int |
Specifies the number of <option> elements the selection list contains. |
writable |
4.6 or later |
multiple |
boolean |
When true, indicates that more than one option may be selected from the list. |
writable |
4.6 or later |
name |
String |
Specifies the name of the form control. This is the name portion of the name-value pair that is submitted with the form. |
writable |
4.6 or later |
options |
Returns an index of the <option> elements contained within the selection list. Index positions begin at 0 and continue to HTMLOptionsCollection.length-1. |
read only |
4.6 or later |
|
selectIndex |
int |
Specifies the index position of the selected option. |
writable |
4.6 or later |
size |
int |
Specifies the number of visible rows. |
writable |
4.6 or later |
tabIndex |
int |
Specifies the tabbing order of the form control. |
writable |
4.6 or later |
type |
String |
Returns the type of form control. The value returned depends on the value of HTMLSelectElement.multiple: |
read only |
4.6 or later |
value |
String |
Specifies the value of the currently selected option(s). This is the value portion of the name-value pair that is submitted with the form. |
writable |
4.6 or later |
Methods
Method: HTMLSelectElement.add()
The add() method adds a new option to the selection list.
If the before parameter is null, this method provides the same functionality as Node.appendChild(). Otherwise, this method functions the same as Node.insertBefore().
Parameters
Method: HTMLSelectElement.blur()
Method: HTMLSelectElement.focus()
Method: HTMLSelectElement.remove()
Parameters
Parameter |
Type |
Description |
|---|---|---|
index |
int |
The position in the HTMLSelectElement.options index of the element to remove from the selection list. |