如何清除 IE 中选定的文件
以下示例适用于 Chrome,但不适用于 IE(任何版本)
HTML
<input id="file1" type="file" class="" multiple="" required="" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
Jquery
$("#fileUpload").val('');
正如预期的那样,IE 不支持此功能。
最佳答案
您可以使用以下 IE 解决方法
$("#image").remove("");
$("form").append(' <input id="image" type="file" name="image"/>');
fiddle - http://jsfiddle.net/nfvR9/25/
关于jquery - 从 IE 中的输入类型 = 文件中删除选定的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30916412/