X
HOME HTML5 CSS3 JAVASCRIPT SQL PHP5 JQUERY ANGULAR BOOTSTRAP3 XML MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Select multiple Property

Select Object Reference 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 Reference Select Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook