No button to reset an INPUT FILE field


(Niente0) #1

Hi all, I’d like to have an option in devtool to be able to reset an input type=file field (for debugging purposes). I don’t know if it already exists, if yes it’s well hidden.
Thank you


(Nicolas Chevobbe) #2

I don’t think there’s such thing indeed.
What you can do though is set the value from the console:

document.querySelector("input[type=file]").value = ""

if you have the element selected in the inspector, you can also do:

$0.value = ""

(Niente0) #3

Thank you for your solution, it works great!!
Anyway it would be nice to implement this reset feature in context menu or in another place in devtools to get faster access. :grinning:


(Luca) #4

It could be a good idea for also other fields. Maybe a “reset” context menu entry on each field, reset it, and the same action on the form tag, will reset the entire content