Example Group together related options with <optgroup> tags: <select> <optgroup label="Swedish Cars...
Example
Group together related options with <optgroup> tags:<select> <optgroup label="Swedish Cars"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> </optgroup> <optgroup label="German Cars"> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option> </optgroup> </select> |
Definition and Usage
The required label attribute specifies a description for a group of options.Browser Support
The label attribute is supported in all major browsers.Syntax
<optgroup label="value"> |
Attribute Values
Value | Description |
---|---|
text | Description of the contained options |