function setImagePreviews() {
var oInput = document.getElementsByTagName('input')[0];
var oList = document.getElementById('list');
oList.innerHTML = "";
// 获取上传图片的个数
var fileList = oInput.files;
for (var i = 0; i < fileList.length; i++) {
if (oInput.files && oInput.files[i]) {
createLi(window.URL.createObjectURL(oInput.files[i]));
console.log(oInput.files[i].name);
}
}
function createLi(ImgSrc) {
var oLi = document.createElement('li');
var oImg = document.createElement('img');
oImg.src = ImgSrc;
oLi.appendChild(oImg);
oList.appendChild(oLi);
}
}