tl;dr: For modern browsers, just use
input.value = ''
or input.value = null
;
Old answer:
How about:
input.type = "text";
input.type = "file";
I still have to understand why this does not work with webkit.
Anyway, this works with IE9>, Firefox and Opera.
The situation with webkit is that I seem to be unable to change it back to file.
With IE8, the situation is that it throws a security exception.
Edit:
For webkit, Opera and firefox this works, though:
input.value = '';
(check the above answer with this proposal)
I'll see if I can find a nice cleaner way of doing this cross-browser without the need of the GC.
Edit2:
try{
inputs[i].value = '';
if(inputs[i].value){
inputs[i].type = "text";
inputs[i].type = "file";
}
}catch(e){}
Works with most browsers. Does not work with IE < 9, that's all.
Tested on firefox 20, chrome 24, opera 12, IE7, IE8, IE9, and IE10.