English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag Encyclopedia

HTML: <input> multiple attribute

The multiple attribute is a boolean attribute that specifies whether multiple values are allowed to be entered in the <input> element. The multiple attribute is applicable to the following input types: email and file.

 HTML <input> tag

Online Example

File upload field, accepts multiple values:

<!DOCTYPE html>
<html>
<head>
<title>HTML: <input> multiple attribute - Basic Tutorial Website(oldtoolbag.com)</title>
<body>
<form action="action_page.php">
  Select images: <input type="file" name="img" multiple>
  <input type="submit">
</form>
When browsing local files, you can try to select multiple files.</p>
</html>
Test to see ‹/›

Browser compatibility

IEFirefoxOperaChromeSafari

Internet Explorer 10Firefox, Opera, Chrome, and Safari support the multiple attribute.

Note:Internet Explorer 9 Previous versions of the software do not support the multiple attribute of the <input> tag.

Definition and usage

The multiple attribute is a boolean attribute.

If present, it specifies that the user can enter multiple values in the<input>element.

Note: The multiple attribute applies to input types: email and file.

Tip: For<input type ="file">: To select multiple files, hold down the CTRL or SHIFT key when selecting.

Tip: For<input type ="email">: Separate each email address in the email field with a comma, for example: [email protected], [email protected], [email protected].

HTML 4.01 with HTML5differences

The multiple attribute is in HTML5 with the new attributes.

Differences between HTML and XHTML

In XHTML, attribute shorthand is prohibited, the multiple attribute must be defined as <input multiple="multiple" />.

Syntax

<input multiple>
 HTML <input> tag