Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what events are bound?

Tags:

jquery

events

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

like image 505
Adrian Crapciu Avatar asked Jul 20 '10 08:07

Adrian Crapciu


2 Answers

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
like image 74
balupton Avatar answered Nov 14 '22 21:11

balupton


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

 $._data($('selector')[0],'events')
like image 28
Rodrigo Perez Burgues Avatar answered Nov 14 '22 22:11

Rodrigo Perez Burgues