The normal idea is to clear the input content every time after getting the input file. I searched on Baidu and found that some methods use the reset of the form, but what if it is just a separate input="file" without the from element? Moreover, some of the methods found online have poor compatibility. Do experienced drivers have any reliable methods?
I just saw this method, how is the compatibility?
欧阳克2017-06-14 10:54:52
input.addEventListener('click', function() {
this.value = '';
}, false);
学习ing2017-06-14 10:54:52
Several ideas:
1. Set the value of input to '', the same as above.
2. Replace the current input with a new input
3. Remove the value attribute of the input.