Even after clearing, the value of my file input remains
P粉714780768
P粉714780768 2024-04-06 15:44:52
0
1
500

As you can see in the screenshot. I select a file, keep the popup without refreshing the page, and then open it again and the file input is still the file I selected.

<input id="fileuploadbannermobile" type="file" name="files[]">

I try this while the popup is open.

$("#fileuploadbannermobile").val('');

But it doesn't seem to solve the problem.

P粉714780768
P粉714780768

reply all(1)
P粉523335026

Setting the input value to an empty string or null will definitely work.

  • Try setting value to "" or null in vanila javascript

    yourInput.value = null or yourInput.value = ""

  • Also check that you have set these values ​​to the correct input

It is also useful to know which browser you are using.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template