0

Firebug only show HTML and CSS by default. How can I find events attached to a DOM element? I want to inspect a theme but I don't know how I find events attached to a DOM element because there is no debugger.

Firebug executes code without showing anything. Is there a way to show those events?

Sebastian Zartner
  • 18,808
  • 10
  • 90
  • 132
Muhammad Nasir
  • 2,126
  • 4
  • 35
  • 63
  • 1
    In chrome's dev tool, goto "Elements" tab. On right you'll see Styles, Computed, Event Listeners.... There you'll get all binded listeners for each event type, find what you need there. – Vivek Sep 18 '15 at 10:51
  • The questioner asks for the functionality in Firebug, not the Chrome DevTools. – Sebastian Zartner Sep 18 '15 at 12:55

3 Answers3

0

There is a universal solution for this

  • Hit F12 to open Dev Tools
  • Click the Sources tab
  • On right-hand side, scroll down to "Event Listener Breakpoints", and expand tree Click on the events you want to listen for. *Interact with the target element, if they fire you will get a break point in the debugger
Shailendra Sharma
  • 6,976
  • 2
  • 28
  • 48
0

If you are using jQuery, you can get a list of all registered events of an HTML element (not a jQuery object or selector) by executing

jQuery._data( elem, "events" );

in your firebug console.

Click here for more details.

Community
  • 1
  • 1
mitchbrand
  • 232
  • 1
  • 3
  • 12
0

Firebug 2 has an Events side panel within the HTML panel listing all events attached to an element.

*Events* side panel within Firebug

It even displays wrapped listeners. I.e. if you're using a library like jQuery, you normally don't want to see the event handler function of jQuery but your own one, which is shown prefixed by a >.

Sebastian Zartner
  • 18,808
  • 10
  • 90
  • 132