WML » Tags » optgroup

<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


<?xml version="1.0"?>
<card id="ic" title="Ice Cream">
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 title="Unpopular Flavors">
      <option value="cpr">Cinnamon Prune </option>
      <option value="gb">Green Bean </option>
      <option value="nunu">Nutty Nutmeg</option>
Language(s): WML

See Also: