How To Select Multiple Items In HTML: Easy Tutorial With Code Example

Disclosure: Your support helps keep the site running! We earn a referral fee for some of the services we recommend on this page. Learn more
Attribute of
The Role Of In HTML Forms (To Create Drop-Down Lists)
What does How To Select Multiple Items In HTML: Easy Tutorial With Code Example do?
Lets the user select more than one option in the list

Code Example

<p><strong>Select your favorite species of flamingo. You may control-click (Windows) or command-click (Mac) to select more than one.</strong></p>

<select multiple size="6">
          <option value="American">American flamingo</option>
          <option value="Andean">Andean flamingo</option>
          <option value="Chilean">Chilean flamingo</option>
          <option value="Greater">Greater flamingo</option>
          <option value="James's">James's flamingo</option>
          <option value="Lesser">Lesser flamingo</option>
</select>

Select your favorite species of flamingo. You may control-click (Windows) or command-click (Mac) to select more than one.

Multiple List Selections

Adding the multiple attribute to <select> allows the user to select more than one option. The user will need to hold down the ctrl or cmd key to select more than one option in the list, so you will need to add some explanatory text. If your list is long, it’s a good idea to set a larger size so that multiple options are visible at the same time. This can save scrolling. As an alternative to multiple, consider using the checkbox input type.

Claire is seasoned technical writer, editor, and HTML enthusiast. She writes for HTML.com and runs a content agency, Red Robot Media.

Browser Support for multiple

iefirefoxchromeedgesafariopera
AllAllAllAllAllAll