HTML DOM OptionObject


Option Object

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

Each time an <option> tag appears in an HTML form, an Option object is created.

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


Option Object Properties

W3C:W3C Standard.

Property Description W3C
defaultSelected Returns the default value of the selected attribute. Yes
disabled Sets or returns whether an option should be disabled. Yes
form Returns a reference to the form that contains the option. Yes
index Returns a reference to the <form> element that contains this element. Yes
selected Sets or returns the value of the selected attribute. Yes
text Sets or returns the plain text value of an option. Yes
value Sets or returns the value sent to the server. Yes

Standard Properties and Events

The Option object also supports standardPropertiesandEvents。

Other Extensions