1updateList = function() {
2 var input = document.getElementById('file');
3 var output = document.getElementById('fileList');
4
5 output.innerHTML = '<ul>';
6 for (var i = 0; i < input.files.length; ++i) {
7 output.innerHTML += '<li>' + input.files.item(i).name + '</li>';
8 }
9 output.innerHTML += '</ul>';
10}
1<input type="file" name="file" id="file" multiple
2 onchange="javascript:updateList()" />
3<br/>Selected files:
4<div id="fileList"></div>