How to select multiple options in a dropdown list with JavaScript?

HTMLJavascriptProgramming Scripts

To select multiple options in a drop-down list, use the multiple properties. It allows you to select more than one option while pressing CTRL key.


You can try to run the following code to learn how to select more than one options at once in a dropdownlist.

Live Demo

<!DOCTYPE html>
      <form id="myForm">
         <select id="mySelect">
         <input type="button" onclick="multipleFunc()" value="Select multiple options">
      <p>Press CTRL and click above button to select multiple options at once.</p>
         function multipleFunc() {
            document.getElementById("mySelect").multiple = true;
Updated on 20-May-2020 08:56:06