JSFiddle - React, Tailwind, and code Playground
by raam86
HTML
<div id=”dropzone”>DROP</div>
CSS
div{
width:500px;
height:600px;
background:darkblue;
}
JavaScript
var dropzone = document.getElementById('dropzone');
dropzone.ondrop = function (e) {
var length = e.dataTransfer.files.length;
for (var i = 0; i < length; i++) {
var file = e.dataTransfer.files[i];
console.log(file);
}
};