I'm using a function from here on SO to reset a file input element.
<input type="file" id="image-file" />
JS:
function resetFormElement(e) {
e.wrap('<form>').closest('form').get(0).reset();
e.unwrap();
e.stopPropagation();
e.preventDefault();
}
resetFormElement($('#image-file'));
Resetting it seems to work but it gives the type error for stopPropagation()
and preventDefault()
in the console