HTML option Tag

HTML option Tag defines the list of options for the drop down menu. HTML option tag is used inside the select tag. User can select one or more options at a time.

Syntax of HTML option Tag

The Syntax of HTML option Tag is shown below, It has both starting tag and ending tag.

<option>
</option>

Usage of HTML option Tag

HTML option Tag is used to make a drop down list or menu. This drop down menu contains more than one options. The option tag is used to list options inside the select tag.

option tag is also used inside the optgroup tag and datalist tag. The optgroup tag defines the group of same types of options. While datalist tag defines pre-defined options for the input tag.

Example of HTML option Tag

Simple example of HTML option Tag is given below.

<select name="languages">
<option value='html'>HTML</option>
<option value='css'>CSS</option>
<option value='javascript'>JavaScript</option>
<option value='php'>PHP</option>
</select>

In above example we have used option tags to make a drop down list of web languages.

value attribute is used to define values for each option which will be stored in database.

selected attribute is used to specify the pre-selected option, this option will be selected automatically once the page loads.

Output

Output of above code is shown below.

Browser Support for HTML option Tag

HTML option Tag is supported by all major browsers which include Chrome, Opera, Firefox, Edge, Internet Explorer and Safari.

Global Attributes Support in HTML option Tag

The HTML option Tag supports all Global Attributes.

Event Attributes Support in HTML option Tag

The HTML option Tag supports all Event Attributes.

HTML option Tag Video

Watch our video on HTML option Tag.

HTML anchor Tag HTML abbr Tag HTML acronym Tag HTML address Tag HTML applet Tag HTML area Tag HTML article Tag HTML aside Tag HTML audio Tag HTML b Tag HTML base Tag HTML basefont Tag HTML bdi Tag HTML bdo Tag HTML big Tag HTML blockquote Tag HTML body Tag HTML br Tag HTML Button Tag HTML Canvas Tag HTML Caption Tag HTML Center Tag HTML Cite Tag HTML Code Tag HTML Col Tag HTML colgroup Tag HTML comment Tag HTML data Tag HTML datalist Tag HTML dd Tag HTML del Tag HTML details Tag HTML dfn Tag HTML dialog Tag HTML dir Tag HTML div Tag HTML dl Tag HTML Doctype Tag HTML dt Tag HTML em Tag HTML embed Tag HTML fieldset Tag HTML figcaption Tag HTML figure Tag HTML font Tag HTML footer Tag HTML form Tag HTML frame Tag HTML frameset Tag HTML Heading Tags HTML head Tag HTML header Tag HTML hr Tag HTML html Tag HTML i Tag HTML iframe Tag HTML img Tag HTML input Tag HTML ins Tag HTML kbd Tag HTML label Tag HTML legend Tag HTML li Tag HTML link Tag HTML main Tag HTML map Tag HTML mark Tag HTML meta Tag HTML meter Tag HTML nav Tag HTML noframes Tag HTML noscript Tag HTML object Tag HTML ol Tag HTML optgroup Tag HTML option Tag HTML output Tag HTML p Tag HTML param Tag HTML picture Tag HTML pre Tag HTML progress Tag HTML q Tag HTML rp Tag