Sets or retrieves whether more than one item from a list can be selected.

The select element, or the selection list of the keygen element allows simple or multiple selection, depending on the state of the multiple property.

If multiple selection is allowed, the visual appearance of the selection list can only be a list box.

If only one selected element is allowed, the selection list may be a drop-down list or a list box.
The default appearance is the drop-down list in that case.

You can set the count of the visible rows in a selection list with the size property.

If the value of the size property is greater than one, the appearance of the selection list is a list box.

In a non-empty drop-down list always exactly one selected element exists.
If there is no element selected by default in a drop-down list, the first option will be selected.

In a single-selection list box the count of the selected items can be 0 (if the list box does not have a selected element by default) or 1.

In a multiple-selection list box the count of the selected items can be from 0 to the number of the items.

You can set the element(s) selected by default with the SELECTED attribute.

If only one selected element is allowed in the selection list, the selectedIndex property contains the index of the
selected item in the options collection of the tag.
If you need the value of the selected option in a single-selection list, you can use the value property of the select element.

If multiple selection is allowed, you can get the selected elements by iterating through the options collection of the tag and
check the value of the selected property of every option tag.

If there is no selected element, the value of the selectedIndex property is -1.

If you want to use the selection list in an form element and you want to submit data that belongs to the
selection list with the form, see the page for the select element, you can find detailed technical information there.

Possible values:

Example HTML code 1:

This example illustrates the use of the MULTIPLE attribute:

Hold down the CTRL key to select more than one element.<br/><br/><selectid="mySelect"multiple="multiple"size="7"><optionselected="selected"/>Component_1</option><option/>Component_2</option><option/>Component_3</option><option/>Component_4</option><option/>Component_5</option><option/>Component_6</option><option/>Component_7</option></select>