Back to Concepts

<optgroup>

Group related options.

The `<optgroup>` tag is used to group related options in a `<select>` element (drop-down list). If you have a long list of options, grouping of related options are easier to handle for a user.

Live Example & Code

Preview Output
<select>
  <optgroup label="Swedish Cars">
    <option value="volvo">Volvo</option>
    <option value="saab">Saab</option>
  </optgroup>
</select>
HTMLViz
© 2026 HTMLViz. Open Source Learning.