Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect browser supports this HTML5 feature

I want to detect (using javascript/jQuery) whether the user's browser supports multiple attribute to input type='file' tag. A feature of HTML5 to add multiple images.

<input type=file  name="images" value=" " multiple=""/>

Please suggest me how can i do this.

like image 706
Rusi Nova Avatar asked Jan 17 '23 18:01

Rusi Nova


2 Answers

var i = document.createElement("input");
if (typeof i.multiple !== 'undefined') {
    // supports multiple
}
like image 76
karim79 Avatar answered Jan 19 '23 08:01

karim79


you can use modernizr which is developed for this purpose.

http://modernizr.com/

you can detect support of a feature like placeholder in this way:

if (!Modernizr.input.placeholder) {

}
like image 29
undefined Avatar answered Jan 19 '23 08:01

undefined