我使用 Jasny Bootstrap 进行文件输入: http ://www.jasny.net/bootstrap/javascript/#fileinput
是否可以指定输入文件类型以仅接受图像?像这样:
<input type="file" name="pic" id="pic" accept="image/gif, image/jpeg" />
我使用 Jasny Bootstrap 进行文件输入: http ://www.jasny.net/bootstrap/javascript/#fileinput
是否可以指定输入文件类型以仅接受图像?像这样:
<input type="file" name="pic" id="pic" accept="image/gif, image/jpeg" />
是的,这是可能的,因为它是输入标签的标准属性值。贾斯尼对此没有任何改变。
但是,您应该知道接受标签并非在所有浏览器中都有效:http: //caniuse.com/#feat=input-file-accept