Drag and Drop Examples—Dragging a DIV

This page will work on IE, but not well. Sometimes it will let you drag and drop some of the items.


Drop Here

Drop Here

Drop Here

Code

function drag(draggableitem, e) {
  e.dataTransfer.setData("Text", draggableitem.id);
}
function drop(target, e) {
  var id = e.dataTransfer.getData('Text');
  target.appendChild(document.getElementById(id));
  e.preventDefault();
}