Latest web development tutorials
 

Select multiple Property

< Select Object

Example

Allow multiple selection in a drop-down list:

document.getElementById("mySelect").multiple = true;
Try it Yourself »

Definition and Usage

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


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The multiple property is supported in all major browsers.


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;

The result of x will be:

false
Try it Yourself »

Related Pages

HTML reference: HTML <select> multiple attribute


< Select Object