html drag and drop example in javascript Example: drag and drop html function drag(ev) { ev.dataTransfer.setData("text", ev.target.id); }