Created
May 7, 2014 13:42
-
-
Save fedir/4b41a9ba89ecd01ed672 to your computer and use it in GitHub Desktop.
Drag & Drop HTML5 - full example http://jsfiddle.net/WhL38/8/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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