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>.
A multiple attribute on an <input> tag.
The file input control let users select multiple image files.
<form action="/tutorial/fileupload.html">
Select and upload one of more image files: <br /> <br />
Step 1 <input type="file" name="file"
accept=".jpg,.png" multiple> <br /> <br />
Step 2 <input type="submit">
</form>
For additional details see our HTML input multiple Reference.
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.
<tagname multiple>
The following elements accept the multiple
attribute.
Elements | Description | |
---|---|---|
<input> | Specifies an input field -- see example above | |
<select> | Creates a dropdown element. |
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.
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 |