i need to change the drag element while been dragging. in this case, i need to change the word "HELLO" to "HI" but if the user does not perform a drop, the element should be back to the original state, "HELLO". https://i.stack.imgur.com/QNBLD.png
I really need this. can any one help me please. Thanks in advance,
CAFC
my code: DEMO JSFIDDLE
$(document).ready(function()
{
var td1 = $("#A");
var td2 = $("#B");
td1.draggable({
cursor: "move",
appendTo: "body",
helper: "clone",
opacity: "0.5",
revert: "invalid"
});
td2.droppable({
accept: 'div',
drop: function (event, ui) {
var x = $(ui.draggable).html();
$(this).html(x);
}
});
});