HTML <optgroup> (Option Grouping) Tag

❮ Previous Home Next ❯


  <optgroup label="Group 1">
    <option>Option 1.1</option>
  <optgroup label="Group 2">
    <option>Option 2.1</option>
    <option>Option 2.2</option>
  <optgroup label="Group 3" disabled>
    <option>Option 3.1</option>
    <option>Option 3.2</option>
    <option>Option 3.3</option>


The <optgroup> element specifies a grouping of items in a selection list defined by option elements so that the menu choices can be presented in a hierarchical menu or similar alternative fashion to improve access through nonvisual browsers.


Version: HTML 4, 4.01, 5

Standard Syntax

  <optgroup label="text">

Browser Support



Attribute Value Description
disabled disabled It's a Boolean attribute specifies that an option-group should be disabled
label text Specifies a label for an option-group

Global Attributes

<optgroup> element also supports the Global Attributes in HTML.

Event Attributes

<optgroup> element also supports the Event Attributes in HTML.

By Default CSS Value(s)


Related Tags:

<button>, <datalist>, <fieldset>, <form>, <input>, <label>, <legend>, <meter>, <optgroup>, <option>, <output>, <progress>, <select> and <textarea>
❮ Previous Reference Next ❯