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

<optgroup></optgroup>

By , About.com Guide

<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

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

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

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

All rights reserved.