How to check if an element is droppable, draggable or other 'ble'?

Kees C. Bakker picture Kees C. Bakker · Nov 21, 2011 · Viewed 19.8k times · Source

I've got a bunch of elements with jQuery. Some are draggable, some are droppable and some are both. How can I detect if an element is draggable or droppable?

Answer

Zim picture Zim · Nov 21, 2011

You could also use jQuery data() like this..

if ($(elem).data('draggable')) {
        alert("yes");
}
else {
        alert("no");
}

if ($(elem).data('fooable')) {
        alert("yes");
}
else {
        alert("no");
} 

See it here: http://bootply.com/60153