Skip to content
Related Articles

Related Articles

HTML | multiple Attribute

View Discussion
Improve Article
Save Article
  • Difficulty Level : Basic
  • Last Updated : 31 Aug, 2022
View Discussion
Improve Article
Save Article

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/select multiple>

Elements: This method can have following attributes: 
 

Attribute: The attribute for each of the above element is multiple
Example: With <input> element
 

html




<!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>
</center>
</body>
 
</html>

Output: 
 

Example: With <select> element 
 

html




<html>
 
<body>
    <center>
        <h1 style="color:green;font-style:italic;">
        Geeksforgeeks
        </h1>
        <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>
 
 
</center>
 
</body>
 
</html>

Output: 
 

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

  • Google Chrome 2
  • Edge 12
  • Firefox 3.6
  • Opera 12.1
  • Safari 4

 


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!