js获取上传文件个数 以及名称

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<input type="file" name="file" id="file" multiple="multiple" />
<div id="info_box"></div>
<script>
var fileDom = document.getElementById("file");
var infoBoxDom = document.getElementById('info_box'); fileDom.addEventListener("change", upload, false);
function upload(){
var list = this.files;
for( var i = 0 ; i < list.length ; i++ ){
infoBoxDom.innerHTML += list[i].name+"<br>";
}
infoBoxDom.innerHTML += list.length+'个文件';
}
</script>
</body>
</html>

  

上一篇:我如何解决Centos下cannot find a valid baseurl for repo的问题的


下一篇:VM(虚拟机安装win7 提示 :units specified don't exist, SHSUCDX can't install)解决方法