How to specify that a user can enter more than one value in an input element in HTML5? Last Updated : 24 Apr, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report The multiple attribute is used to specify whether the user can enter more than one value in an input element. It is a Boolean attribute. When set to true, the input element can accept more than one value. The multiple properties can be used in the following ways. With the <input> tag only the Email and File type accepts the multiple attribute.With the <select> tag when the multiple attribute is used, most of the browsers display a scrolling list box instead of the simple one line dropdown list. This allows the user to select multiple options. Example 1: This example shows how multiple emails can be entered in the input area. Each email is separated by a comma. Any trailing and leading whitespaces are removed from each address in the list. HTML <html> <body> <form action=" "> <p> <label> Write down the E-Mails of the peoples you want to send the mail </label> <br> <sub> (You can enter multiple E-Mail with each separated by comma) </sub> <input type="email" name="email" id="email" multiple size="50"> </p> <p> <input type="submit" value="Submit"> </p> </form> </body> </html> Output: Before entering the email addresses After entering the email addresses Example 2: This example shows how multiple files can be selected using the <input> tag. Normally only one file is allowed, however using the multiple, the user can select more than one file. HTML <html> <body> <form action=" "> <p> <label for="file"> Upload the image files : </label> <input type="file" name="upload" id="upload" multiple accept=".jpeg,.jpg,.png"> <br><br> <label for="file"> Upload the Text files : </label> <input type="file" name="upload" id="upload" multiple accept=".txt"> </p> <p> <input type="submit" value="Submit"> </p> </form> </body> </html> Output: Before adding the files: After adding the files: Example 3: This example shows how multiple options can be selected in a <select> input. The user can select zero or more options from the list of options by using the CTRL button or use a solution given by the developer. HTML <html> <body> <form action=" "> <p> With multiple attribute: <label for="course"> Select the course you like: </label> <select multiple name="course" id="course"> <option>HTML</option> <option>CSS</option> <option>JavaScript</option> <option>Java</option> <option>C++</option> <option>C</option> <option>Python</option> </select> </p> <p> Without multiple attribute: <label for="course"> Select the course you like: </label> <select name="course" id="course"> <option>HTML</option> <option>CSS</option> <option>JavaScript</option> <option>Java</option> <option>C++</option> <option>C</option> <option>Python</option> </select> </p> <p> <input type="submit" value="Submit"> </p> </form> </body> </html> Output: Comment More infoAdvertise with us Next Article How to specify that the user is required to select a value before submitting the form in HTML5 ? J jimishravat2802 Follow Improve Article Tags : Web Technologies HTML HTML5 HTML-Questions Similar Reads How to specify a short hint that describes the expected value of an input element using HTML ? The placeholder attribute specifies a short hint for input field that describes the expected value of an input field/text area. The short hint is displayed in the field before the user enters a value. Syntax: <element placeholder="value"> Attribute Value: This attribute describes the short hin 1 min read How to specify the value of an input element using HTML ? In this article, we will set the value of an input element using HTML. The value attribute for <input> element in HTML is used to specify the initial value of the input element. It has different meaning for different input type: The âbuttonâ, âresetâ and âsubmitâ property specifies the text on 1 min read How to Set a Minimum and Maximum Value for an input element in HTML5? To set minimum and maximum values for an input element in HTML5, we utilize the min and max attributes. For numerical inputs like type numbers, assign the desired limits directly. Alternatively, use JavaScript validation, pattern attributes, or event listeners for more complex validation scenarios, 3 min read How to specify the type of an input element using HTML ? In this article, we will specify the type of an input element using HTML. The HTML <input> type attribute is used to specify the type of <input> element to display. The default type of <input> type attribute is text. Syntax: <input type="value"> Attribute Values: button: It i 4 min read How to specify that the user is required to select a value before submitting the form in HTML5 ? The purpose of this article is to specify that the user is required to select a value before submitting the form in HTML5. This will force the user to enter a value before a form is submitted. The <select> required attribute can be used for this purpose. It is a boolean attribute that states a 2 min read How to specify the name of an input element? To add the name of an input element, we use the HTML <input> name attribute. The HTML <input> name attribute is used to specify a name for an <input> element. It is used to reference the form data after submitting the form or to reference the element in JavaScript. Syntax:<input 2 min read Like