HTML5 Drag and Drop only images
问题 What i'm trying to do is : if all the dragged files was images drop them, but if there was other file exstensions don't drop them, but drop the images only. Here's my try : HTML : <div id="dropzone"></div> Javascript : var dropzone = document.getElementById("dropzone"); dropzone.ondrop = function (e) { e.preventDefault(); e.stopPropagation(); var files = e.dataTransfer.files; for(x = 0; x < files.length; x = x + 1){ if(files[x].type.split("/")[0] == 'image') { console.log(files[x].name + "is