Adrian Crapciu
Adrian Crapciu

Reputation: 265

what events are bound?

Is there any way to see what events are bound to an element with jQuery?

Upvotes: 22

Views: 13477

Answers (3)

Rodrigo Perez Burgues
Rodrigo Perez Burgues

Reputation: 248

This solution is obsolete in new jQuery versions. You must use:

 $._data($('selector')[0],'events')

Upvotes: 8

balupton
balupton

Reputation: 48650

If you are using Safari or Chrome, you can open up the Developer Tools and inspect the element (by clicking the magnifying glass). In the Event Listeners tab on the right it will tell you the binded events to that element, with their functions and locations.

OR to do this via code:

$('selector').data('events'); // get
console.dir($('selector').data('events')); // display in firefox firebug or webkit's developer tools

Upvotes: 29

Māris Kiseļovs
Māris Kiseļovs

Reputation: 17285

If you don't need this in script, you can check that element in any DOM inspection tool like Firebug and see all events.

Upvotes: 0

Related Questions