JSFiddle - React, Tailwind, and code Playground

HTML

<a id="dragable" style="display:block;width:100px;height:100px;border:1px solid red;">Drag here</a>

JavaScript

document.getElementById('dragable').ondragover = function(e){e.preventDefault();  }
document.getElementById('dragable').ondrop = function(e){ upload_drop(e); }


function upload_drop(e){
e.preventDefault();
alert('drag and drop works.');
}