I wrote this simple javascript code:
$("input[type='file']").attr("value", "");
It works in Firefox and Chrome but not in IE (I tried in IE9)
What’s the good approach to empty the input type file value ?
Thank you
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are some restriction on input type = file
You can read here
This seems to be working in IE8, IE9
To test in IE8 I changed the compatibility mode in developer tool to IE8
Edit:
As for many IE hacks I think this is better