Reputation: 53786
Can I access the div id of a droppable element within jQuery :
$(".all").droppable({
drop: function(event, ui) {
// Get the droppable div id here
}
});
Upvotes: 1
Views: 79
Reputation: 69905
Inside the drop
event $(this)
represents the droppable element and ui.draggable
represents the draggable. You can try this.
$(".all").droppable({
drop: function(event, ui) {
alert(this.id);
}
});
Upvotes: 0
Reputation: 268324
You can use this.id
, or get that from the ui.helper
:
$( ".all" ).droppable({
drop: function(event, ui) {
alert( ui.helper.id );
}
});
Upvotes: 2