option

FilterElements

<option> ... </option>

Defines an option within a select element (a multiple-choice menu or scrolling list). The content of the option element is the value that is sent to the form-processing application (unless an alternative value is specified using the value attribute).

Notes

In HTML5, the option element may also be used within the new datalist element.

Start/End Tags

HTML: Required/Optional; XHTML: Required/Required

Specifications

  • HTML 4.01
  • HTML5

disabled

Values: None in HTML. (disabled="disabled" in XHTML)
Indicates that the selection is initially nonfunctional. It can be reactivated with a script.

label=

Values: text
Allows the author to provide a shorter label than the content of the option. This attribute is not supported.

selected

Values: None in HTML. (selected="selected" in XHTML)
Makes this item selected when the form is initially displayed.

value=

Values: text
Defines a value to assign to the option item within the select control to use in place of option contents.
<p>What are your favorite ice cream flavors?</p>
<select name="ice_cream" size="4" multiple="multiple">
<option>Vanilla</option>
<option>Chocolate</option>
<option>Inside-out Rocky Road</option>
<option>Super-duper Praline Pecan Smashup</option>
<option>Mint Chocolate Chip</option>
<option>Pistachio</option>
</select>

Rendered Example

What are your favorite ice cream flavors?