All Tech Tips

OPTGROUP Element | optGroup Object

Allows authors to group choices logically in a select element.

Members Table

AttributePropertyDescription
DISABLEDdisabled Sets or retrieves a value that you can use to implement your own disabled functionality for the object.
LABELlabel Sets or retrieves the label for the option group.

Remarks

In HTML 4.0 , 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 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 World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 .



Copyright © 2006 alltechtips.com. All rights reserved.

This website and the materials and information you find on this website are provided "as is", without warranty of any kind, either express or implied, including without limitation any warranty for information, services, or products provided through or in connection with the service and any implied warranties of merchantability, fitness for a particular purpose, expectation of privacy or non-infringement.
Advertising
health | home | ip address | golf courses | recipes | flooring | rubber flooring | cd duplication | schools