English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag Reference

HTML optgroup label attribute

The optgroup label attribute specifies the label for the option group.

 HTML <optgroup> tag

Online Example

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 ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the label attribute.

Definition and Usage

The label attribute defines a description label for the option group.

HTML 4.01 with HTML5differences

None.

Syntax

<optgroup label="text">

attribute value

valuedescription
textSpecify a label for the option group/Description.
 HTML <optgroup> tag