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/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
Please Login to comment...