There is a common feature of modern browsers where a user can select some text and drag it to an input field. Within the same field it causes moving of text, between differe
Use the following code
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));
}
and:
See: http://jsfiddle.net/zLYGF/25/