HTML and CSS Reference
18.104.22.168. The multiple attribute
To allow more than one option selection at a time, add the multiple at-
tribute to the <select> tag. This causes the <select> element to behave
like an <input type=checkbox> element. When submitted, the browser
collects the multiple selections, separated with commas, into a single
parameter list, such as:
If you don't include the multiple attribute, the user may select only one
option at a time, just like in a group of radio buttons.
22.214.171.124. The size attribute
The size attribute determines how many options are visible to the user
at a time. The value of size should be a positive integer. The default
value is 1. When size=1 without multiple , the browser typically displays
the <select> list as a pop-up menu. With size values greater than 1 or
with multiple , the browser typically displays the <select> element's con-
tents as a scrolling list.
In the following XHTML example, we've converted our previous check-
box example into a scrolling, multiple-choice menu. Notice that the size
attribute tells the browser to display three options at a time: [*]
[*] Notice the </option> end tags. They are not usually included in standard HTML documents but
must appear in XHTML.
What pets do you have?
<select name="pets" size="3" multiple="multiple">