www.fgks.org   »   [go: up one dir, main page]

Click to Rate and Give Feedback
 optGroup Object
OPTGROUP Element | optGroup Object

Allows authors to group choices logically in a select element.

Members Table

The following table lists the members exposed by the optGroup object.

Attributes/Properties
Show:
AttributePropertyDescription
DISABLEDdisabled Sets or retrieves a value that indicates whether the user can interact with the object.
LABELlabel Sets or retrieves the label for the option group.

Remarks

In HTML 4.0 World Wide Web link, all OPTGROUP elements must be specified directly within a SELECT element. Groups may not be nested.

You can add OPTGROUP elements only to a SELECT element located in the same window where the OPTGROUP elements are created.

This element is available in HTML as of Microsoft Internet Explorer 6.

This element is a block element.

This element requires a closing tag.

Example

The following example shows how to use the OPTGROUP element to create groups of items in a drop-down list box.

<SELECT>
    <OPTGROUP LABEL="Alkaline Metals">
        <OPTION>Lithium (Li)</OPTION>
        <OPTION>Sodium (Na)</OPTION>
        <OPTION>Potassium (K)</OPTION>
    </OPTGROUP>
    <OPTGROUP LABEL="Halogens">
        <OPTION>Fluorine (F)</OPTION>
        <OPTION>Chlorine (Cl)</OPTION>
        <OPTION>Bromine (Br)</OPTION>
    </OPTGROUP>        
</SELECT>

Standards Information

This object is defined in HTML 4.0 World Wide Web link.

Community Content
 
Add Community Content
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker
DCSIMG