HTML Tag Reference - HTML tag <option>

This <option> element is used to create a list item in a <select> element list.

Browser compatibility

<option> Yes Yes Yes Yes Yes

What's new in HTML5



Attribute Value Description
disabled disabled disable an option
label text Set a shorter label for an option
selected selected pre-selected an option when the page loads
value text Set the value to be sent to a server

Global Attributes

The <option> tag supports the Global Attributes in HTML.

Event Attributes

The <option> tag supports the Event Attributes in HTML.

Default CSS Settings



A demo showing how to use <option> tag.

          <select name="select1">
              <optgroup label="First Group">
</body><!--from  w  w w  .  j a  v a  2 s.  com-->

Click to view the demo