WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

HTML <optgroup> Tag


Example

Group related options with <optgroup> tags:

<select>
  <optgroup label="Swedish Cars">
    <option value="volvo">Volvo</option>
    <option value="saab">Saab</option>
  </optgroup>
  <optgroup label="German Cars">
    <option value="mercedes">Mercedes</option>
    <option value="audi">Audi</option>
  </optgroup>
</select>
Try it yourself »

Definition and Usage

<optgroup> Tags are often used to group related options together.

If you have many combinations of options, you can use <optgroup> Tags make it easy to group related options together.


Browser Support

Element
<optgroup> Yes Yes Yes Yes Yes Yes

Differences Between HTML 4.01 and HTML5

NONE.


Attributes

Attribute Value Description
disabled disabled Provision is made to disable this option group.
label text Specify a description for the option group.