HTML | PHP | Forum

HTML <optgroup> tag


<optgroup> - </optgroup>

Definition and Usage

The OPTGROUP element defines a group of choices within a SELECT menu. OPTGROUP must contain one or more OPTION elements to define the actual choices.

Required Attributes

Attribute Value Description
label text_label Defines the label for the option group

Optional Attributes

Attribute Value Description
disabled disabled Disables the option-group when it first loads

Standard Attributes

id, class, title, style, dir, lang, xml:lang

For a full description, go to Standard Attributes.

Event Attributes

tabindex, onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

For a full description, go to Event Attributes.


Source Output
<optgroup label="Strategy Games">
<option value ="Civilization">Civilization</option>
<option value ="Conquest">Conquest</option>
<option value ="Age">Age of Mythology</option>
<optgroup label="Sport Games">
<option value ="FIFA2006">FIFA2006</option>
<option value ="NBA">NBA</option>


Learn HTML
HTML Tutorial

HTML Reference
HTML by function
HTML by Alphabet

HTML events
HTML attributes
HTML color names

<h1> to <h6>


Copyright 2005-8 Sunilcare.  All Rights Reserved.
Comments or suggestions? Contact us.About us