label attribute (optgroup)
Sets the text to show as the contents of the option group element.
The displayed text is unselectable in the drop-down list (select), it is useful for grouping the list items.
JavaScript page for this attribute: label. You can find other example(s) there. |
Possible values:
String that sets the label of the group.
Default: this attribute has no default value.
Example HTML code 1:
This example illustrates the use of the label attribute:
|
||||
<select id="mySelect" size="8"> <option selected="selected">None</option> <optgroup label="Fruits"> <option />Apple <option />Pear <option />Peach </optgroup> <optgroup label="Vegetables"> <option />Bean <option />Cole </optgroup> </select> |
||||
|
||||
Did you find this example helpful?
|
Supported by tags:
External links:
User Contributed Comments