Search results
According to the HTML5 spec (dev.w3.org/html5/markup/optgroup.html#optgroup) the only permitted parent of optgroup is select, which suggest that no, this is not supported in HTML5. –
The <optgroup> tag is used to group related options in a <select> element (drop-down list). If you have a long list of options, groups of related options are easier to handle for a user.
25 lip 2024 · The <optgroup> HTML element creates a grouping of options within a <select> element.
10 lut 2024 · The <optgroup> tag is an HTML element specifically designed for use within <select> elements. It allows you to group related <option> elements together, providing a hierarchical structure within a dropdown list.
29 cze 2017 · Using HTML <optgroup> tags, you can select optgroups and define them using a label: Example.
The optgroup tag generates a group of options within a <select> control's dropdown list of values. A sequence of <option> tags define the dropdown values, which are then grouped using the <optgroup> tag.
Syntax. The <optgroup>tag comes in pairs. The content is written between the opening (<optgroup>) and closing (</optgroup>) tags. The <optgroup>tag is generally used with the valueattribute, to specify which value is sent to the server for further processing. Example of the HTML <optgroup>tag: