HTML | multiple Attribute

This attribute is a Boolean Attribute. It specifies that the user is allowed to select more than one value that presents in an element.

Syntax:

<input multiple>

Elements: This method can have following attributes:

  • <input>
  • <select>

Attribute: The attribute for each of the above element is multiple.

Example: With <input> element



filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
<body>
<center>
<h1 style="color:green;font-style:italic;">GeeksForGeeks</h1>
<h2 style="color:green;font-style:italic;">multiple Attribute in Input Element</h2>
<form action=" ">
  Select images: <input type="file" name="img" multiple>
  <input type="submit">
</form>
  
</body>
</html>

chevron_right


Output:

Example: With <select> element

filter_none

edit
close

play_arrow

link
brightness_4
code

<html>
<body>
<center>
<h1 style="color:green;font-style:italic;">Geeksforgeeks</hg1>
<h2 style="font-style:italic;color:green;">multiple Attribute in Select Element</h2>
<form action=" ">
<select name="Bikes" multiple>
  <option value="HeroHonda">HeroHonda</option>
  <option value="Splender">Splender</option>
  <option value="Ninja">Ninja</option>
  <option value="Pulsav">Pulsav</option>
</select>
<input type="submit">
</form>
  
<p>Hold down the Ctrl (windows) / Command (Mac) button to select multiple options.</p>
  
</body>
</html>

chevron_right


Output:

Supported Browsers: The browser supported by multiple Attribute are listed below:

  • Apple Safari 1+
  • Google Chrome 1+
  • Firefox 1+
  • Opera 4+
  • Internet Explorer 2+


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.