WML » Tags » select

<select> ... </select>

The select tag is used to create a select list. A select list offers a selection of choices from which you may choose one or more items.

This tag delimits the beginning and end of the select list. 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.
Further, you can group related items (option elements) together into sub-listings using optgroup elements. The browser usually allows you to display one optgroup element at a time.
A select element cannot contain nested select elements. It can only contain optgroup and 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>

This example demonstrates the use of the select tag to create a select list.

Language(s): WML

See Also: