Reputation: 53806
The draggable element below can be an <li>
element. Can I check if the element dragged is an <li>
using .attr
or some other method?
$(".myCss" ).droppable({
drop: function( event, ui ) {
ui.draggable.attr('class'));
}
});
Upvotes: 1
Views: 44
Reputation: 145398
You can use is
method:
$(".myCss" ).droppable({
drop: function( event, ui ) {
if (ui.draggable.is("li")) {
// ...
}
}
});
DEMO: http://jsfiddle.net/ZsT2Y/
Upvotes: 3