I know the files property is read only. but why could not assign this property to another variable? it works in firefox, but not ie.
My code is:
var element=document.getElementById("fileinput");
var files=document.getElementById("fileinput").files;
alert(element); //here can output HTTPInputElement
alert(files); //but here is always undefined in ie;
I do not know why the four line always give me undefined in ie.
How can I get the filelist object from input|files as variable in ie?
IE9 and below don’t have a files property because they only accept one file at a time.
IE: input type="file" multiple
IE10 is supposed to add actual support, I have not tested it yet.