HTML and CSS Reference
By default, the select list form control acts like a radio button in that it allows one mutually exclu-
sive choice from many. To change the behavior to be like checkboxes, you add the multiple attri-
bute to the <select> tag, like this:
<select name=”region” id=”region” multiple=”multiple” size=”5”>
When you add the multiple attribute, the select list transforms from a drop-down list to a fully
visible menu of selections as shown in Figure 19-7. To make multiple selections, the user must press
Ctrl on the PC, Command on the Mac, or — for contiguous selections — Shift on either platform.
The size attribute determines how large the visible menu should be. If you choose less than the
number of entries, a scroll bar appears so the user can select their option(s) from the entire list.
In this Try It you learn how to add a select list to an online form.
You will need the tpa_saturn.html file from the previous exercise, as well as a text editor and web
Open your text editor.
From the Lesson_19 folder, open the previously saved tpa_saturn.html .
Put your cursor at the end of the opening </p> tag after the closing </textarea> tag and
press Enter (Return).
Enter the following code:
<select name=”age” id=”age”>
<option value=”Under_12”>Under 12 not allowed</option>
<option value=”12_18” selected>12 - 18</option>