Open In App

HTML <input> multiple Attribute

The HTML <input> multiple Attribute is a Boolean Attribute. It specifies that the user is allowed to select more than one value that is present in an element. The multiple attributes work with many input fields such as email, file, etc. 

Syntax:



<input multiple> 

HTML <input> multiple Attribute Example 

Example: This example uses multiple attribute to create a form with multiple file input in single input element.




<!DOCTYPE html>
<html>
    <body>
        <h2>HTML input multiple Attribute</h2>
        <form action=" ">
            Select images:
            <!-- Using multiple attribute
                 for multiple file input-->
            <input type="file" name="img" multiple />
            <input type="submit" />
        </form>
    </body>
</html>

Output:



HTML multiple Attribute

Explanation:

HTML <input> multiple Attribute Use cases

1. How to specify that a user can enter more than one value in an input element in HTML5?

In HTML5, add the multiple attribute to the <input> element, specifically for type file, allowing users to select and submit multiple files simultaneously.

2. How to Select Multiple Files using HTML Input Tag ?

To select multiple files using HTML <input> tag, set its type attribute to “file” and include the multiple attribute, allowing users to select multiple files at once.

Supported Browsers

The browser supported by value attribute in option tag are listed below:

Article Tags :