Get attributes of UI draggable

Get attributes of UI draggable


I am trying to get the attributes of the ui.draggable, but it is
returning nothing at all. What am I missing?
alert($(ui.draggable).attr("id"));
The above returns nothing, not even undefined.