select
element which acts as a container for a group of menu items, each of which is created by using the option
element. Both the select
element and the option
element have start and end tags, e.g. <select>...</select>
and <option>...</option>
.SOURCE CODE
I like my coffee:<br><br>
<select name="coffee">
<option value="black">Black</option>
<option value="cream" selected>With cream</option>
<option value="sugar">With sugar</option>
<option value="regular">With cream & sugar</option>
<option value="crisp">Crisp (har har...)</option>
</select>
option
element— and then placed within a containing select
element. The start <select>
tag contains the control name for the menu item group. In the above example, the control name is "coffee". Each menu item in the group has a different associated value specified by the value
attribute. When a user selects a menu item, its value gets assigned as the current value of the menu item group's control name.selected
attribute. In the above example, the menu item "With cream" is set as the default selection.multiple
attribute in the <select>
start tag. To see this in effect, please refer to the example below.size="nn"
attribute-value pair in the <select>
start tag where nn
equals the number of lines you wish to display. With the menu configured to multiple lines, it loses its 'dropdown' style and becomes a scrollable list of menu items. To see this in effect, please refer to the example below.<optgroup>...</optgroup>
tags. The label="section_name"
attribute-value pair is inserted in the <optgroup>
start tag where section_name
equals the title of the subsection.To see this in effect, please refer to the example below.SOURCE CODE
<select name="coffee2" size="5" multiple>
<optgroup label="Dairy">
<option value="skim">Skim Milk</option>
<option value="milk2">Milk (2%)</option>
<option value="cream" selected>Cream</option>
<option value="whipped">Whipped cream</option>
</optgroup>
<optgroup label="Sweetener">
<option value="sugar">Sugar</option>
<option value="honey">Honey</option>
</optgroup>
<optgroup label="Snack">
<option value="donut">A donut</option>
<option value="danish">A danish</option>
<option value="muffin">A muffin</option>
</optgroup>
</select>
Free Text Editors
Free Graphics Editors
Website Analysis Tools
Free Website Templates
See also:
If you need a .COM web address, you can get one quick and easy at...
<~ BACK | TOP | NEXT ~> |