JSFiddle - React, Tailwind, and code Playground
HTML
<div id="d" draggable="true">
<button id='d'>
drag me
</button>
</div>
CSS
#d {
width:20px;
height:20px;
background-color: red;
}
JavaScript
d = document.getElementById('d');
d.addEventListener('drag', function(e){
console.log("drag:", e)
});
d.addEventListener('dragstart', function(e){
e.dataTransfer.setData('application/node type', this);
console.log("dragstart:", e)
});