How to reset file input type in JQuery
22 Dec 2014If you want to reset the input type using traditional method will not work .
For doing so you wrap()
a <form>
around the element, call reset()
on the newly created form
, then remove the form using unwrap()
function resetFileElement(e) {
e.wrap('<form>').closest('form').get(0).reset();
e.unwrap();
}