Sometimes when uploading files, you will encounter a situation where you need to reset the entire form, but here comes the problem. Other browsers don't have any problems. Just reset the form directly or trigger the click event of the button with type reset. OK, but IE is weird. The File field in IE cannot be cleared. Maybe you see that there is no value anymore, but you can print it out and see:
var fileVal = $('input[type="file"]').val();
alert(fileVal);
The information printed out is still the information of the file selected before reset. How to solve this problem? After checking a lot of information, I found that the following method can be used to solve the problem under IE
$('input[type="file"]') .attr('value','');
//or
$('input[type="file"]').val('');
Of course Don't forget to reset the form.