?
<input type="file" id="input" multiple="multiple"> <div id="content"></div> <script> var inputElement = document.getElementById("input"); inputElement.addEventListener("change", handleFiles, false); function handleFiles(){ var fileList = this.files; var dd = document.getElementById('content'); for( var i = 0 ; i < fileList.length ; i++ ){ dd.innerHTML += fileList[i].name+"<br>"; } } </script>
?
?
<input type="file" id="input" ?multiple="multiple"> 主要是多了个multiple