HTML multiple Attribute

The multiple attribute on a element specifies that multiple items or multiple files can be selected. Elements that accept this attribute include <input> and <select>.

Example

#

A multiple attribute on an <input> tag.
The file input control let users select multiple image files.

Select and upload one of more image files:

Step 1  

Step 2  
<form action="/tutorial/fileupload.html">
   Select and upload one of more image files: <br /> <br />
   Step 1 &nbsp; <input type="file" name="file" 
          accept=".jpg,.png" multiple> <br /> <br />

   Step 2 &nbsp; <input type="submit">
</form>

For additional details see our HTML input multiple Reference.


Using multiple

The multiple attribute specifies that the element accepts multiple selected values.

With this attribute present, users can select one or more items or files.

On an <input> element, the multiple attribute only applies to these input types:

With type="email", multiple comma-separated emails can be entered.


Syntax

<tagname multiple>

Elements that accept multiple

The following elements accept the multiple attribute.

Elements Description
<input> Specifies an input field -- see example above
<select> Creates a dropdown element.

<select> with multiple

A <select> tag with a multiple attribute.
Select multiple cities with Ctrl-click or Shift-click key combinations.


<form action="/tutorial/fileupload.html">
  <select multiple style="height:125px;" name="cities">
    <option value="paris">Paris</option>
    <option value="london">London</option>
    <option value="athens">Athens</option>
    <option value="madrid">Madrid</option>
    <option value="berlin">Berlin</option>
  </select><br />

  <input type="submit">
</form>

For additional details see our HTML select multiple Reference.


Browser support

Here is when multiple support started for each browser:

Chrome
6.0 Sep 2010
Firefox
3.6 Jan 2010
IE/Edge
10.0 Sep 2012
Opera
11.0 Sep 2017
Safari
5.0 Jun 2010

You may also like



Guides