The HTML <optgroup> Tag for Option Groups

Use <optgroup> to group <option> tags in HTML 5

The <optgroup> tag is used to create a group of options in a drop-down box in a <select> list. In most browsers, the option group is displayed as a hierarchy, with the form options under the optgroup label. The option group label will not be able to be selected, but the options under it will be.

The optgroup element is often used in HTML forms. It can also be used in a data list to create a list of suggestions for autocompletion in a combobox.

This is an actual working example of the <optgroup> tag example code below.