< All the HTML Tags >
<optgroup></optgroup>
Video Coming Soon...
Definition:
The HTML <optgroup> tag is used to group related <option> elements within a dropdown list, providing a structured format for selecting options.
It enhances user experience by visually categorizing options, making it easier for users to find what they're looking for in a large list.
Incorporating the `<optgroup>` tag improves the organization of dropdown menus in forms.
Attributes:
disabled, label, Global attributes (e.g., class, id, style)
Accessibility:
Coming Soon…
Default optgroup Example:
<select><optgroup label="Fruits"><option value="apple">Apple</option><option value="banana">Banana</option></optgroup></select>
Default optgroup Result:
Coming Soon…
Community Examples:
Coming Soon…