html代码如下:
<form id="videoForm">
<input type="file" name="file" class="cp" id="fileInput"/>
</form>
每次提交完之后可以执行下面的方法,亲测有效。
方法一:
//JQuery下可以这样写:
$('#fileInput').val('');
//javaScript可以这样写:
document.getElementById('fileInput').value = '';
方法二:
//通过清除form的方法,清除input中的内容
document.getElementById('videoForm') && document.getElementById('videoForm').reset();