HTML <optgroup> Tag


The <optgroup> HTML element is a container inside which the <option> elements are combined into one group. The peculiarity of <optgroup> is that it does not stand out as a regular list item, it is accented with a bold style, and all elements included in this container are shifted to the right of its original position.


Permitted Parents
A <select> element
One or more <option> elements
Start/End Tags
Start tag: required, End tag: required


<optgroup label="Fruits">
<option value="banana">Banana</option>
<option value="orange">Orange</option>
<option value="apple">Apple</option>
<optgroup label="Vegetables">
<option value="carrot">Carrot</option>
<option value="tomato">Tomato</option>
<option value="onion">Onion</option>


Attribute Definition
label Specifies a label for the option group.
disabled Disables the input control. The button won't accept changes from the user. It also cannot receive focus and will be skipped when tabbing.

Global Attributes

The <optgroup> tag also supports the Global Attributes in HTML5

Event Attributes

The <optgroup> tag also supports the Event Attributes in HTML5

Browser Support

The following table will show you the current browser support for the HTML <optgroup> tag.

Edge Chrome Firefox Opera Safari
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview

Last updated by CSSPortal on: 30th March 2024