HTML optgroup tag

<optgroup> tag in HTML

The <optgroup> tag represents a defined group of options , that belongs to a <select> tag.

The <optgroup> tag groups the related items in an drop down list.


label attribute in <optgroup> tag

The label attribute is required in this tag and should provide users with a hint or description about the contents of the group.

Example

Try Yourself

disabled attribute in <optgroup> tag

This attribute is used to disable a complete group of options at once.

This will ban the user from interacting with all options in the disabled group.

Example

Try Yourself