Example

A simple <option> tag that open PNLdev.com link:

Laboratory

description & Usage

For anthology of an option in the relevant list, they use <option> tag.

The tags in which option can be used are:

  • <optgroup> tag.
  • <datalist> tag.
  • <select> tag.

Notes

Note: The <option> tag does not need any attribute, but to send the form data to the server, you need to use the value attribute.

Note: If you have trouble grouping the list options, you can easily get help from the <optgroup> tag.

Browser compatibility and Support

# Chrome Edge Firefox Safari Opera
<option>

Attributes

Attributes Values Description
disabled
disabled
en
label
text
en
selected
selected
en
value
text
en

Global Attributes

The option tag supports the HTML Global Attributes.

Event Attributes

The option tag supports the HTML Event Attributes.

More Examples

Example

HTML An example for the <option> tag using the <datalist> tag - Example #1

Laboratory

Example

HTML An example for the <option> tag using the <optgroup> tag - Example #2

Laboratory