Skip to content
Related Articles

Related Articles

Improve Article

HTML | multiple Attribute

  • Difficulty Level : Basic
  • Last Updated : 19 Jul, 2019

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:

  • <input>
  • <select>

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

Example: With <input> element






<!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>
  
<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 6.0
  • Internet Explorer 10.0
  • Firefox 3.6
  • Opera 11.0
  • Safari 5.0

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.




My Personal Notes arrow_drop_up
Recommended Articles
Page :