English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The optgroup label attribute specifies the label for the option group.
1An option group with a label:
<!DOCTYPE html> <html> <head> <title>HTML:<optgroup> label attribute</title> - Basic Tutorial Website(w3<body>/<title>codebox.com</title> </<head> <body> <select> <optgroup label="German Cars" disabled> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option> </optgroup> </select> </body> </html>Test it out ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the label attribute.
The label attribute defines a description label for the option group.
None.
<optgroup label="text">
value | description |
---|---|
text | Specify a label for the option group/Description. |