Geek's Portal For Computers Graphics Operating Systems Multi-Media Networking Programming Data Format and  News
[ Start Page ] [ Contacting ] [ About ] [ Link To Us ] [ Geek Gear ] Sat, Jul 5 2008 
Free Internet Tools by web-geek.com Internet Tools
Administrator Tools
Name Server Look Up
Ping Test
Who Is
Trace Route

Web Developer Tools
Web Safe Colors
HTML Character Map
PopUp Generator
Body Color CSS v1.0
Browser Information
Meta Tag Generator
Keywords Generator
Link Popularity
JavaScript Escape / Unescape Converter
JavaScript Drop Down Menu Builder
Web / Virtual Hosting Directory

Reference Documention
HTML 4.0 Reference

Reference Tables
Character Conversion Table
Domain Name Suffixes

Cheat Sheets
Vi / Vim Basic Commands


WEB-GEEK.COM's Feature Sites Feature Sites
oGobogo Internet Search Directory
News.web-geek.com Internet News Directory
Pdawebgeek.com PDA Friendly Web Directory
Games.web-geek.com Free Online Games


folder HTML 4.0

OPTGROUP - Option Group

Syntax <OPTGROUP>...</OPTGROUP>
Attribute Specifications
Contents One or more OPTION elements
Contained in SELECT

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.

The required LABEL attribute specifies the group label presented to the user. The LABEL should describe the group of choices available through the OPTGROUP's OPTIONs. Each OPTION generally uses a LABEL attribute as well to provide a shortened label that, together with the OPTGROUP's LABEL, gives a complete description of the option. An example follows:

<P>Which Web browser do you use most often?
  <SELECT NAME=browser>
    <OPTGROUP LABEL="Netscape Navigator">
      <OPTION LABEL="4.x or higher">
        Netscape Navigator 4.x or higher
      </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="4.x or higher">
        Microsoft Internet Explorer 4.x or higher
      </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>

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.

Non-supporting browsers will ignore the OPTGROUP elements and LABEL attributes, providing the full name and version for each choice. Thus authors can fully use OPTGROUP despite its lack of browser support.

Note that, in HTML 4.0, OPTGROUP is limited to containing only OPTION elements, thus preventing nested OPTGROUPs with multi-level cascades. Future versions of HTML may add support for nested option groups.

The boolean DISABLED attribute makes the option group unavailable. The options of a disabled option group cannot be selected by the user and are never submitted with the form.

More Information

Copyright © 1998 by Liam Quinn. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/).


Sponsor Sponsor


  © 1999-2006, web-geek.com a Geek Boy Enterprises, Inc. website terms and conditions of use [ Start Page ] [ Contacting ] [ About ] [ Link To US ]