FANDOM


The HTML <optgroup></optgroup> element is used to group together related <option> elements in a <select> list.


Attributes

Attribute Value Description
label name Specifies a description for a group of options. This attribute is required for functionality.
disabled Boolean Specifies that an option group should be disabled.


HTML example:

<select>
      <optgroup label="Basic Colors">
         <option value="Red">Red</option>
         <option value="Blue">Blue</option>
         <option value="green">Green</option>
      </optgroup>
      <optgroup label="Other Colors">
         <option value="Crimson">Crimson</option>
         <option value="Lightblue">Lightblue</option>
         <option value="Limegreen">Limegreen</option>
      </optgroup>
</select>

External Links

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.