XML technologies / HTML & XHTML / Alphabetical list of HTML and XHTML elements / optgroup

(Excerpt from "HTML & XHTML ─ kurz & gut" by Jennifer Niederst Robbins)

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

   

optgroup

HTML 4.01 | HTML 5

<optgroup> ... </optgroup>

Defines a group of option elements within a select form element. An optgroup element can contain further optgroup elements.

Start/end tag

HTML 4.01 and XHTML: required/required; HTML 5: required/optional

Attributes

Core, internationalization, events, global HTML 5 attributes

  • disabled (disabled="disabled" in XHTML)

    Indicates that the group of options is disabled. A script can enable it again.

  • label="Text"

    Required. Defines a label for the group.

Example

<p>Welche Eiscreme schmeckt Ihnen am besten?<p>
<select name="eis" size="6" multiple="multiple">
<optgroup label="Traditionell">
  <option>Vanille</option>
  <option>Schokolade</option>
</optgroup>
<optgroup label="Exotisch">
  <option>Kokos-Curry</option>
  <option>Lavendel</option>
  <option>Blauschimmelkäse</option>
</optgroup>
</select>

 

> back to the alphabetical list of elements

   

 

 

 

back to top