optgroup Description:
The optgroup HTML tag defines a group of options in a select list of an HTML form. It allows designers to style portions of the select list drop-down field and allows for labels of those groups within the list.
optgroup Web Browser Support:
- Chrome 1, 2, 3, 4, 5, 6, 7, 8, 9
- Firefox 1, 2, 3
- Internet Explorer 6, 7, 8
- Opera 6, 7, 8, 9, 10, 11
- Safari 1, 2, 3, 4, 5
- WebTV/MSN TV
HTML Versions
optgroup Attributes:
optgroup End Tag:
</optgroup> REQUIRED
optgroup Contents:
HTML. The following tags are valid within the optgroup tag:
option
optgroup Valid Context:
optgroup Usage:
Typical option list with labels on option groups
<form action="#">
<label for="list">Name your favorite pet</label>
<select name="list">
<optgroup label="mammals">
<option>dog</option>
<option>cat</option>
<option>rabbit</option>
<option>horse</option>
</optgroup>
<optgroup label="reptiles">
<option>iguana</option>
<option>snake</option>
</optgroup>
</select>
</form>
optgroup Special Notes:
- Use this tag to create groups within the select options.

