HTML <option>Tag


Examples

Create a selection list with 4 options:

<select>
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="opel">Opel</option>
  <option value="audi">Audi</option>
</select>

Try it Yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

Most mainstream browsers support the <option> tag.


Tag Definition and Usage Instructions

The <option> tag defines an option (an entry) in a drop-down list.

The content of the <option> tag is used as<select>or<datalist>an element.


Tips and Notes

Note:The <option> tag can be used without any attributes, but you usually need to use the value attribute, which indicates the content that will be sent to the server.

Note:Please use this tag together with the select element, otherwise this tag is meaningless.

Tip:If there are many list options, you can use the <optgroup> tag to group related options.


Attributes

Attribute Value Description
disabled disabled Specifies that this option should be disabled on initial load.
label text Defines the label to be used when using <optgroup>.
selected selected Specifies that the option appears in a selected state (when first displayed in the list).
value text Defines the option value to be sent to the server.


Global Attributes

The <option> tag supports global attributes. View the full attribute listHTML Global Attributes。


Event Attributes

The <option> tag supports allHTML Event Attributes。

Other Extensions