Skip to content

Instantly share code, notes, and snippets.

@fedir
Created May 7, 2014 13:42
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 fedir/4b41a9ba89ecd01ed672 to your computer and use it in GitHub Desktop.
Save fedir/4b41a9ba89ecd01ed672 to your computer and use it in GitHub Desktop.
Drag & Drop HTML5 - full example http://jsfiddle.net/WhL38/8/
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));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment