HTML <option> tag

Updated: 05/08/2017 by Computer Hope

HTML option tagWhen writing in HTML, the <option> tag is used to designate an item within the <optgroup>, <datalist>, or <select> elements. These options can be selected using a drop-down menu, or via autocomplete if the user starts typing one of them. The following sections contain information about the <option> tag, including an example of it in use, as well as related attributes and browser compatibility.

Note: The <option> tag belongs to a group of tags called form elements.

Example code

<div>Choose your favorite color from this list:</div>
<input list="colors" />
<datalist id="colors">
<option value="Red">
<option value="Green">
<option value="Blue">
<option value="Orange">
<option value="Purple">

Example result

Choose your favorite color from this list:

If you hover your mouse cursor over the right side of the box, a down arrow will appear. Click this arrow to choose your favorite color.


Within an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair; all tags support standard attributes. The following table shows all of the current unique HTML attributes for the <option> tag, as well as a description of each.

Attribute Description
disabled Disables the option
label Designates a short label for an option
selected Designates that the option should be selected as soon as the page loads
value Designates a value to best sent to the server then the option is selected


Internet Explorer Firefox Safari Opera Chrome
All versions All versions All versions All versions All versions

Additional form elements

Browser, Compatibility, Server