HTML DOM Option object
Option object
The Option object represents an option in the drop-down list in the HTML form.
Every time a label appears in an HTML form, an Option object is created.
You can access an Option object through the form's array of elements, or by using document.getElementById().
Option object properties
W3C: W3C standard.
Attributes | describe | W3C |
---|---|---|
defaultSelected | Returns the default value for the Selected property. | Yes |
disabled | Set or return options should be disabled. | Yes |
form | Returns a reference to the form that contains the option | Yes |
index | 返回对包含该元素的 <form> 元素的引用。 | Yes |
selected | Set or returns the value of the selected property. | Yes |
text | Set or return a plain text value of a certain option. | Yes |
value | Set or returns the value sent to the server. | Yes |
Standard properties and events
Option objects also support the standard properties and events.