file输入框无法清空

来源:互联网 发布:福克斯st轮毂数据 编辑:程序博客网 时间:2024/06/05 15:42
<input   accept="application/excel, application/vnd.ms-excel,application/x-excel, application/x-msexcel" id="file" type="file" name="huamingce"/>



上传文件时候,file输入框无法清空。


解决方式:clone一个,删掉原来的.

if(data=='fail'){                        $.messager.alert("提示",data.msg);          var file = $("#file");          file.after(file.clone().val(""));          file.remove();         }


原创粉丝点击