Latest

recent

HTML Optgroup label attribute

Example

Group together related options with <optgroup> tags:
<select>
  <optgroup label="Swedish Cars">
    <option value="volvo">Volvo</option>
    <option value="saab">Saab</option>
  </optgroup>
  <optgroup label="German Cars">
    <option value="mercedes">Mercedes</option>
    <option value="audi">Audi</option>
  </optgroup>
</select>


Definition and Usage

The required label attribute specifies a description for a group of options.

Browser Support

The label attribute is supported in all major browsers.

Syntax

<optgroup label="value">

Attribute Values

Value Description
text Description of the contained options
HTML Optgroup label attribute Reviewed by 1000sourcecodes on 21:35 Rating: 5
Powered by Blogger.