views:

498

answers:

2

One can bind Javascript events to html elements without using inline declarations.

Is there a way when inspecting an html element to know which events are bound to the element? I want to know about the events defined by the developer and not the internal ones that come with the browser.

So if I hover over an element and a menu shows up, I want to know which method caused it.

I have been trying Event Spy with the Code inspector but it logs too many of the internal ones, unless I am not using it right.

+2  A: 

There's no way to enumerate listeners added with addEventListener in Firefox core (bug 448602).

There may be workarounds, but I'm not aware of any. See also http://stackoverflow.com/questions/446892/how-to-find-event-listeners-on-a-dom-node

[edit] Oh wait, determine "which events are bound"? Did you mean which events can fire on the node? If so, you should clarify your question.

Nickolay
I want to know the event handlers that were added in JQuery's Ready() function. Events like change, blur, click, etc..
Tony_Henrich
If the events handlers are attached using jquery, then NV's answer is what you need.
Nickolay
+5  A: 
NV
Cool. Keep in mind that it only recognizes event listeners added using on of supported libraries, not using the raw DOM API (addEventListener).
Nickolay