For example, i associate following function with some element
$('table#users tbody tr:first #save').click(function(){
$(this).closest('tr').remove();
});
Now, if i don’t know where this function is stored, is there a way to view associated with click() code? In above example, i want a way to view that in firebug, or in another way
$(this).closest('tr').remove();
If I’m writing in console following, i’m get a link to dom inspector
>>> ($('table#users tbody tr:first #save').click)
function()
but link is for jquery library, not the code i want.
I think this will answer your question How to find event listeners on a DOM node when debugging or from the JavaScript code?
The reason you get a link to the DOM inspector on the code you wrote is because calling
$(selector).clickwill actually raise the click events and return the result set.