Das HTML-Element <optgroup>
Bedeutung:
Definiert eine Gruppe von Auswahlmöglichkeiten <option>.
Beispiel:
Download html5-tag_optgroup.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <select> <optgroup label="Kaltgetränke" > <option value="mineralwasser" >Mineralwasser</option> <option value="fruchsaft" >Fruchtsaft</option> </optgroup> <optgroup label="Heissgetränke" > <option value="kaffee" >Kaffee</option> <option value="tee" >Tee</option> </optgroup> <optgroup label="Alkoholische Getränke" disabled=""disabled" > <option value="wein" >Wein</option> <option value="sekt" >Sekt</option> </optgroup> </select> |
Auswirkung:
Attribute:
Name | Wert | Beschreibung |
---|---|---|
disabled | disapled | Deaktiviert die Auswahlmöglichkeiten der Gruppe |
label | Text | Legt eine Beschriftung für die Auswahlgruppe fest. |