HTML4 HTML5
Used to group related options (<option> tags) inside a drop-down select list (<select>)[cite: 3]. Makes navigation through long lists easier for users by dividing items into readable categories[cite: 3].
Both opening and closing tags are mandatory[cite: 3].
Attributes:
label – (required) header text visible in the drop-down list, representing the name of the option group[cite: 3].disabled – disables the entire option group, preventing the user from selecting any item in that group[cite: 3].class, id, and style are also used[cite: 3].Code:
The browser will interpret this code as follows: