Drag and Drop Using Native DOM Methods
Drag and Drop
Demo of drag and drop using only native DOM methods.
Usage: Grab one of the randomly generated elements and drag it around the four droppable zones. When when the drag is complete, the item will be appended to the "destination" zone.
The demo shows simple uses of:
- Drag and Drop API (https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API)
- Generators (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*)
- Immediately invoked function expressions (https://developer.mozilla.org/en-US/docs/Glossary/Function)
- Closures (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures)