multiple attribute of the select tag (XHTML 1.1)

default is single selection

A standard select list only allows the selection of one option, but what if we wanted our user to be able to select more than one? That's exactly what the boolean multiple attribute is for. Here's an example:

 

<select name="Persons" multiple="multiple"> 
     <option>Anyone</option> 
     <option>John Doe</option> 
     <option>Jane Doe</option> 
</select>

The result will look like this:

 

 

Select one item by clicking it, and more items by holding down the <Ctrl> or <Shift> key on your keyboard while clicking.

 

Possible values

Value
<boolean>

multiple exists in these tags

Attribute Deprecated Description
optgroup option group 
option selectable choice 
select option selector 



© htmlpedia.net 2008 - 2012