I am using input type="file", Now my requirement is that I only want to select png images, that is when I select browse a "png" filter should be applied.
I have referred www.w3schools.com/tags/att_input_accept.asp
and below is the code I am using, this works fine with Chrome but does not work with Firefox and IE.
Please can anyone help me understand what wrong I must be doing ?
<h2>Below uses accept="image/*"</h2>
<input type="file" name="pic1" accept="image/*" />
<h2>Below I need to accept only for png</h2>
<input type="file" name="pic1" accept="image/png" />
?Here is a fiddle link to it http://jsfiddle.net/Jcgja/2/
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…