New! My 44-page ebook "CSS in 44 minutes" is out! 😃

Get it now →

# optgroup

Defines a group of <option> elements.

Example: Copy

<select>
<optgroup label="South America">
<option>Uruguay</option>
<option>Brazil</option>
<option>Argentina</option>
</optgroup>
<optgroup label="Europe">
<option>Italy</option>
<option>Germany</option>
<option>England</option>
<option>France</option>
<option>Spain</option>
</optgroup>
</select>

Example: Copy

<select>
<optgroup label="Winter">
<option>December</option>
<option>January</option>
<option>February</option>
<option>March</option>
</optgroup>
<optgroup label="Not winter" disabled>
<option>April</option>
<option>May</option>
<option>June</option>
<option>July</option>
<option>August</option>
<option>September</option>
<option>October</option>
<option>November</option>
</optgroup>
</select>

label

Defines the label for the whole group.

"South America"

The label is not selectable.

disabled

Disables all the options of the group.

No value required.