The HTML5 <optgroup> tag is important when putting a drop down list within the HTML document. The main purpose of the HTML5 <optgroup> tag is to group all related options. Because of this, it is easier for the author to collate all options even if there is a long list of these.
Using the HTML <optgroup> tag is similar in both HTML 4.01 and HTML5.
To make tasks easier for the author, using the HTML5 <optgroup> tag is hassle-free since it is compatible for the major web browsers like Internet Explorer, Google Chrome, Safari Opera and Firefox. Even better, the HTML5 <optgroup> tag is also supportive of the Global Attributes and Events Attributes in HTML5.
Here is the list of attributes for HTML5 <optgroup> tag:
|
Attribute
|
Value
|
Description
|
|
label
|
text
|
This is used when putting a label for the option-group
|
|
disabled
|
disabled
|
This is used in indicating that an option-group has to be disabled
|