tags:

views:

12

answers:

1

I have a list:

<ul id="selector">
   <li id="1">One</li>
   <li id="2">Two</li>
</ul>

and then I have:

$("#selector li").draggable({
revert: "valid"
});
$("#xyz tr").droppable({
drop: function(event, ui) {
console.log(ui.draggable.text());
}
});

Q: How do I determine that it was id=1 or id=2 that was dropped? The text property is giving me "One" or "Two", but I need "1" or "2".

+2  A: 
ui.draggable.attr('id')
Scott Evernden