'Allow drag text and drop it in html input field without clearing previous data

I am working on Django application that require input field. The user can drag text and drop it in input field. But it clears the previously entered data . I want all typed and draggable text in input field. How can i achieve this?

<script type="text/javascript" >
{
  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.value = $("#" + data).html();
  }

}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source