WML » Tags » optgroup

Syntax:
<optgroup> ... </optgroup>

The optgroup tag is used to group related option elements in a select list created using the select tag. A select list offers a selection of choices from which users may choose one or more items.

This tag delimits the beginning and end of each related group. It also serves as a container element for a collection of option elements where each option element contains one item to be displayed in the list.
 
An optgroup element can be nested inside of other optgroup elements. It cannot contain any other WML elements or any text (other than the text in the option elements).
 
Nested Tags:  optgroup  option

Examples

Code:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.WAPforum.org/DTD/wml_1.1.xml">
<wml>
<card id="ic" title="Ice Cream">
<p>
Click Select<br />
<select name="favorite" title="Pick your favorite!">
   <optgroup title="Future Flavors">
      <option value="cd">Coconut Delight</option>
      <option value="cf">Coffee</option>
      <option value="mns">Maple Nut Swirl</option>
      <option value="rs">Raspberry Sorbet</option>
   </optgroup>
   <optgroup title="Unpopular Flavors">
      <option value="cpr">Cinnamon Prune </option>
      <option value="gb">Green Bean </option>
      <option value="nunu">Nutty Nutmeg</option>
   </optgroup>
</select>
</p>
</card>
</wml>
Language(s): WML

See Also: