<input type="file" name="file" id="file" style='visibility: hidden;' name="img" onchange="fileSelected();"/>
I have spent sometime to get the file input element reset correctly while I was developing a HTML5 application. I have found several ways of doing it while I was researching, but most of them were not worked as I expect. The below mentioned piece of jquery code worked fine in several desktop as well as mobile browsers. So I thought of sharing it.
works with Chrome, FireFox, Opera ,Safari and IE10 and above
works with below IE10