TAG:  optgroup

<optgroup> ... </optgroup>
 
The optgroup tag is used to group together related items in a pull-down form control. An item can only be added to the group by using the option tag. Both the optgroup and option tags must be used inside the opening and closing select tags.
 
You cannot nest this tag.
 
The separate closing tag is mandatory.
 
Attributes and Events
 
class    dir    id    lang    onclick    ondblclick    onkeydown    onkeypress    onkeyup    onmousedown    onmousemove    onmouseout    onmouseover    onmouseup    style    title
 
disabled
The disabled attribute is used to disable the caption group. The only permitted value is diabled.
 
label
The label attribute is used to specify a short caption.
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="eng">
<head>
<title>DevGuru XHTML optgroup Tag Example</title>
</head>
<body>
<select>
<optgroup label="Mexican tropical fish">
<option>Molly</option>
<option>Platy</option>
<option>Sword Tail</option>
</optgroup>
<optgroup label="Goldfish">
<option>Comet</option>
<option>Oranda</option>
<option>Ryukin</option>
</optgroup>
</select>
</body>
</html>

 
Output:


Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information