HTML optgroup Tag

HTML<optgroup>Tag: The HTML<optgroup> groups all the related options in a drop-down list. If you have a long list of options, groups of related options are easier to handle for a user.


This HTML optgroup tag supports both the global and the event attributes.

Syntax: <optgroup> Text </optgroup>


  • label
  • Disabled

Browser Compatibility

The HTML optgroup tag is supported by different types of browsers.

  • Chrome
  • Firefox
  • Opera
  • Safari
  • Internet Explorer


<!DOCTYPE html>
  <optgroup label="HTML">
    <option value="HTML">HTML</option>
    <option value="CSS">CSS</option>
  <optgroup label="JAVA">
    <option value="JAVA">JAVA</option>
    <option value="C">C</option>


HTML optgroup tag

Attributes that are supported by the <optgroup> tag

Attribute Value Description
disabled disabled Describes that an option-group must be deleted
label text Describes a label for an option-group

Global and event attributes

This HTML tag supports all global and event attributes.