<option>: The HTML Option element
<option> HTML element is used to define an item contained in a
<optgroup>, or a
<datalist> element. As such,
<option> can represent menu items in popups and other lists of items in an HTML document.
Text, possibly with escaped characters (like
The start tag is mandatory. The end tag is optional if this element is
immediately followed by another
|Implicit ARIA role||
|Permitted ARIA roles||No
This element includes the global attributes.
If this Boolean attribute is set, this option is not checkable. Often browsers grey out such control and it won't receive any browsing event, like mouse clicks or focus-related ones. If this attribute is not set, the element can still be disabled if one of its ancestors is a disabled
This attribute is text for the label indicating the meaning of the option. If the
labelattribute isn't defined, its value is that of the element text content.
If present, this Boolean attribute indicates that the option is initially selected. If the
<option>element is the descendant of a
multipleattribute is not set, only one single
<select>element may have the
The content of this attribute represents the value to be submitted with the form, should this option be selected. If this attribute is omitted, the value is taken from the text content of the option element.
<option> element is highly limited. Options don't inherit the font set on the parent. In Firefox, only
background-color can be set however in Chrome or Safari it's not possible to set any properties. You can find more details about styling in our guide to advanced form styling.
<select> for examples.
|HTML Standard |
BCD tables only load in the browser