I am using a drag & drop functionality where i drag item and dropthe text in droppable item.
Draggable Item :
<li id="test" data-text="Test \n Drag"><label>Test Drag</label></li>
Droppable Item :
<textarea id="testtextarea"></textarea>
I want to drop text from draggable item with carriage return
Means Output would be
Test is first line and drag in Second line
I am using following Jquery
$("li").draggable({
// snap: false, snapMode: 'both', revert: false,
appendTo: "body",
helper: "clone",
zIndex: 100,
}); $("#testtextarea").droppable({
drop: function (event, ui, e) {
$("#testtextarea").val($("#test").attr("data-text"));
} });