w3schools.com

Select multiple Property

❮ Select Object

Example

Allow multiple selection in a drop-down list:

document.getElementById("mySelect").multiple = true;

Try it Yourself »


Description

The multiple property sets or returns whether more than one option/item can be selected from a drop-down list.


Browser Support

Property
multiple Yes Yes Yes Yes Yes

Syntax

Return the multiple property:

selectObject.multiple

Set the multiple property:

selectObject.multiple = true|false

Property Values

Value Description
true|false Specifies whether more than one option in a drop-down list can be selected
  • true - Multiple selection is allowed
  • false - Default. Multiple selection is not allowed


Technical Details

Return Value: A Boolean, returns true if multiple selection in the drop-down list is enabled, otherwise it returns false

More Examples

Example

Find out if more than one option in a drop-down list can be selected:

var x = document.getElementById("mySelect").multiple;

Try it Yourself »


Related Pages

HTML reference: HTML <select> multiple attribute


❮ Select Object

Read the original on w3schools.com ↗