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粉5233350262024-04-07 10:47:55
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.