The following code changes a div's background-color when another div is dragged on it. How can I modify it it to change divs's text instead of background colour (for example I drop a div with a <p>Test</p> inside it and I want to the div which was dragged onto to change its text to <p>Test</p>
code:
$(".snap").droppable({
drop: function (event, ui) {
var drag = ui.draggable;
var drop = $(this);
$(this).html(drag.html());
$(this).attr('name', drag.attr('id'));
debugger;
}
});
Please check my JSFiddle code which is not working: