Web Design / HTML

  1. Home
  2. Computing & Technology
  3. Web Design / HTML

<optgroup></optgroup>

By Jennifer Kyrnin, About.com

<optgroup> Description:

The <optgroup> element defines groups of options in a select list.

<optgroup> Web Browser Support:

<optgroup> Attributes:

<optgroup> End Tag:

</optgroup> REQUIRED

<optgroup> Contents:

HTML. The following tags are valid within the <optgroup> tag:
option

<optgroup> Valid Context:

The <optgroup></optgroup> tag is valid within the following tags:
select, form

<optgroup> Usage:

  • basic options list
    <form>
    <select name="list">
    <option>Name your favorite pet
    <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.

More <optgroup></optgroup> Information:

Return to XHTML Element (HTML Tags) Library

Explore Web Design / HTML

About.com Special Features

Web Design / HTML

  1. Home
  2. Computing & Technology
  3. Web Design / HTML

©2009 About.com, a part of The New York Times Company.

All rights reserved.