我使用ajax来保存文件,但我想卸载或更改状态到没有选择的文件,换句话说,我想卸载,在我的操作完成后卸载图像。
答案 0 :(得分:1)
使用
$(function(){
$("button").click(function(){
$("input[type='file']").val("");
});
});
例如
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="file">
<button>reset</button>
&#13;
{{1}}&#13;