Possible Duplicate:
Inspect attached event handlers for any DOM element
Is there a tool – such as a browser extension, jQuery console script, bookmarklet or Firebug plugin – that displays all events that can be fired by a particular DOM element, and include any event handlers currently listening to those events?
You are looking for:
FireQuery
http://firequery.binaryage.com/
To do it your own, you can always access the
events datastructure from ajQuery object.Example:
That would list all events into your FireBug/Webkit console and print it’s event handler functions as plain text. You can remove the
.toString()part or just logv2the get more detailed information.update
Like Anurag commented, that will show you only handlers which were bound through
jQuery. It will not lookup upaddEventhandler() / addHandleror inline-event handlers.You can lookup inline-event handlers by checking for the
on-xxxattribute.DOM level3does implementhasEventListenerNS, but I don’t think any browser uses those yet.