views:

1910

answers:

2

Duplicate:

How to find event listeners on a DOM node?
How to debug Javascript/jQuery event bindings with FireBug (or similar tool)

I am using Firebug to inspect HTML codes and CSS. I need to find what are the events and the handlers associated to an element.

Using the Inspect button, I can see all the CSS, but can't find the event handlers.

A: 

This will alert all functions associated to a given element...

var elem = document.getElementById('ELEMENT_ID_HERE');
var str = '';
for(var prop in elem) {
  if(typeof elem[prop] == 'function')
    str += prop + '\n';
}
alert(str);
Josh Stodola