我知道文件属性是只读的。但为什么不能将此属性分配给另一个变量?它适用于 Firefox,但不适用于 IE。
我的代码是:
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;
我不知道为什么四行在ie中总是给我undefined。 如何从 input|files 中获取文件列表对象作为 ie 中的变量?
最佳答案
关于javascript - 为什么 input|file 无法将其属性 "files"分配给 ie 中的变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12961944/