I want to add some class to each clone of 'mydraggable' when it is dropped inside the sortable. But I am not sure of how to acheive this. I also wants to make the dropped clone of mydraggable as sortable so that if I drop something inside of the newly cloned inside droppable It should function same as parent sortable.
Following is my HTML
<div id="mydraggable" >I am First<span class="myhandler">DRAG<span></div>
<div id ="sortable" class="mysortable" contenteditable="true"></div>
Following is my JS
<script>
$('#mydraggable').draggable({
connectToSortable: ".mysortable",
helper: "clone",
revert:"invalid",
});
$( ".mysortable" ).sortable({
placeholder: "highlight_me",
cursor: "move",
handle: ".myhandler",
revert: true,
receive:function(event , ui){
alert($(this).html());
//$(this).addClass('ui-sortable');
}
});