Easy Tutorial
❮ Event Clientx Prop Element Scrollleft ❯

HTML DOM


Option Object

The Option object represents an option in a dropdown list within an HTML form.

Each occurrence of the <option> tag in an HTML form creates an Option object.

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 the 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 the element. Yes
selected Sets or returns the value of the selected attribute. Yes
text Sets or returns the text value of an option. Yes
value Sets or returns the value to be sent to the server. Yes

Standard Attributes and Events

The Option object also supports standard attributes and events.

❮ Event Clientx Prop Element Scrollleft ❯