javascript - Regarding input="file", the change event is not triggered when the same file is selected repeatedly
学习ing
学习ing 2017-06-14 10:52:52
0
2
1055

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?

学习ing
学习ing

reply all (2)
学霸
input.addEventListener('click', function() { this.value = ''; }, false);
    学习ing

    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.

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!