Skip to content

Instantly share code, notes, and snippets.

@javacafe01
Created December 4, 2021 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save javacafe01/56706db57f9460e9944cb4975bf3a1ee to your computer and use it in GitHub Desktop.
Save javacafe01/56706db57f9460e9944cb4975bf3a1ee to your computer and use it in GitHub Desktop.
function allowDrop(ev) {
ev.preventDefault();
}
function drag(ev) {
ev.dataTransfer.setData("text", ev.target.id);
}
function drop(ev) {
ev.preventDefault();
var data = ev.dataTransfer.getData("text");
ev.target.appendChild(document.getElementById(data));
}
@javacafe01
Copy link
Author

ss

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment