HTML and CSS Reference
In-Depth Information
1.
<select name="day">
2.
<option value="Friday" selected>Friday</option>
3.
<option value="Saturday">Saturday</option>
4.
<option value="Sunday">Sunday</option>
5.
</select>
Figure 10.11
A drop-down menu created using the
<input>
and
<option>
ele-
ments
Multiple Selections
The Boolean attribute
multiple
, when added to the
<select>
element for a standard
drop-down list, allows a user to choose more than one option from the list at a time. Ad-
ditionally, using the
selected
Boolean attribute on more than one
<option>
element
within the menu will preselect multiple options.
The size of the
<select>
element can be controlled using CSS and should be adjusted
appropriately to allow for multiple selections. It may be worthwhile to inform users that to
choose multiple options they will need to hold down the Shift key while clicking to make
their selections.
1.
<select name="day"
multiple
>
2.
<option value="Friday" selected>Friday</option>
3.
<option value="Saturday">Saturday</option>
4.
<option value="Sunday">Sunday</option>
5.
</select>
Figure 10.12
A drop-down list that allows users to select multiple options
Search WWH ::
Custom Search