HTML <optgroup> Element Reference

The HTML <optgroup> element labels a group of related options in a selection control.

<optgroup>

HTML <optgroup> Element Reference

The HTML <optgroup> element labels a group of related options in a selection control.

Categories

  • Forms

Tag omission

Consult the HTML Living Standard for the precise tag-omission rules.

Content model

  • Detailed content-model guidance will be added to this reference.

Attributes

Examples

Example

A practical optgroup element example.

<select>
  <optgroup label="Metric"><option>Meter</option></optgroup>
  <optgroup label="US customary"><option>Foot</option></optgroup>
</select>

Related references

Description

The HTML <optgroup> element labels a group of related options in a selection control.

References

  1. HTML Living Standard: Index of elements
  2. MDN: HTML <optgroup> Element

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies