I have a lot of UL with li. Different ULs will have li with the same identifier:
<ul> <li id='1'>this</li> <li id='2'>that</li> </ul> <ul> <li id='1'>this</li> </ul>
The user can drag li from the list to another, but only if li with the same identifier does not exist. So far I have this:
$(".container").droppable({ drop: function (event, ui) { var a = $(this).find("li").attr("id", $(ui.draggable).attr('id')); if (a.length == 0) { $.ajax({ ... }); } } });
However, when I drop the draggable, it changes the id of all li to the value of the reset li.
Any guidance would be great. Thanks.
abarr source share