Search results
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.
- Label
Code Editor (Try it) With our online code editor, you can...
- Option
Definition and Usage. The <option> tag defines an option in...
- Ol
Well organized and easy to understand Web building tutorials...
- HTML
Well organized and easy to understand Web building tutorials...
- OptionGroup Object
With our online code editor, you can edit code and view the...
- Label
23 lut 2020 · 7 Answers. Sorted by: 69. I don't think you can but you can easily reproduce the visual style with css and thus only have options in your select, so everything is selectable. .optionGroup { font-weight: bold; font-style: italic; } . .optionChild { padding-left: 15px; } <select multiple="multiple">
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.
The W3Schools online code editor allows you to edit code and view the result in your browser
25 lip 2024 · This element includes the global attributes. If this Boolean attribute is set, none of the items in this option group is selectable. Often browsers grey out such control and it won't receive any browsing events, like mouse clicks or focus-related ones.
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.
In CodePen, whatever you write in the HTML editor is what goes within the <body> tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html> tag. If you want to add classes there that can affect the whole document, this is the place to do it.