Syntax
<OPTGROUP>...</OPTGROUP>
Attribute Specifications
LABEL=Text (group label)
DISABLED (disable group of choices)
common attributes
Contents:
One or more OPTION elements
Contained in:
SELECT
<P>Which Web browser do you use most often?
<SELECT NAME=browser>
<OPTGROUP LABEL="Netscape Navigator">
<OPTION LABEL="6.x or higher">Netscape Navigator 6.x or higher</OPTION>
<OPTION LABEL="5.x">Netscape Navigator 5.x</OPTION>
<OPTION LABEL="4.x">Netscape Navigator 4.x</OPTION>
<OPTION LABEL="3.x">Netscape Navigator 3.x</OPTION>
<OPTION LABEL="2.x">Netscape Navigator 2.x</OPTION>
<OPTION LABEL="1.x">Netscape Navigator 1.x</OPTION>
</OPTGROUP>
<OPTGROUP LABEL="Microsoft Internet Explorer">
<OPTION LABEL="6.x or higher">Microsoft Internet Explorer 6.x or higher</OPTION>
<OPTION LABEL="5.x ">Microsoft Internet Explorer 5.x</OPTION>
<OPTION LABEL="4.x ">Microsoft Internet Explorer 4.x</OPTION>
<OPTION LABEL="3.x">Microsoft Internet Explorer 3.x</OPTION>
<OPTION LABEL="2.x">Microsoft Internet Explorer 2.x</OPTION>
<OPTION LABEL="1.x">Microsoft Internet Explorer 1.x</OPTION>
</OPTGROUP>
<OPTGROUP LABEL="Opera">
<OPTION LABEL="3.x or higher">Opera 3.x or higher</OPTION>
<OPTION LABEL="2.x">Opera 2.x</OPTION>
</OPTGROUP>
<OPTION>Other</OPTION>
</SELECT>
</P>
Which Web browser do you use most often?
OPTGROUP is not well supported by current browsers, but its design allows authors to use it today without sacrificing compatibility with non-supporting browsers. Supporting browsers will render the preceding example using the LABEL attribute of OPTION to provide just the version number, along with the OPTGROUP's LABEL, which gives the full name of the application. This allows a compact display with easy-to-use cascading menus.