获取<input type="file" name="upload">
的值使用 jQuery,你可以使用 $('input').val()
.
但是,用同样的方法得到<input type="file" name="upload[]" multiple>
的值(多文件输入)只返回一个文件,而不是所有文件。
有没有其他方法可以做到这一点?
最佳答案
尝试进入控制台
document.forms[index].elements[index].files
缓存值并循环遍历它们
关于jquery - 如何使用 jQuery 获取多文件输入的更改值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8813774/