draggable

PHOTO EMBED

Sat Feb 26 2022 02:37:22 GMT+0000 (UTC)

Saved by @mboljar

<script>
const allowDrop = (e) => e.preventDefault();
const drag = (e) => e.dataTransfer.setData("text", e.target.id);
const drop = (e) => {
  var data = e.dataTransfer.getData("text");
  e.target.appendChild(document.getElementById(data));
}
</script>
<div ondrop="drop(event)" ondragover="allowDrop(event)" style="width:150px; height:50px; padding: 10px; border:1px solid black"></div>
<p id="drag" draggable="true" ondragstart="drag(event)">Drag me into box</p>
content_copyCOPY

https://madza.hashnode.dev/24-lesser-known-html-attributes-you-may-want-to-use