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

HTML Referenzhandbuch

Vollständiges Verzeichnis der HTML-Tags

HTML optgroup label Eigenschaft

Die optgroup-label-Eigenschaft legt ein Label für die Optionsgruppe fest.

 HTML <optgroup> Tag

Online-Beispiel

1eine Gruppe von Optionen mit Label:

<!DOCTYPE html>
<html>
<head>
<title>HTML:<optgroup> label Attribute</title> - Basic Tutorial Website(oldtoolbag.com)</title>/<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 specifies a description label for the option group.

HTML 4.01 and HTML5differences between

None.

Syntax

<optgroup label="text">

attribute value

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