views:

80

answers:

1

Is there any way to retreive a list of events of a DOM in Javascript?

e.g. I register FuncA, FuncB, FuncC for the onclick event using AddEvent or AddEventListener methods. How do I get the reference of all these functions for that onclick event?

Ideally, I want to have a function like this:

eventList = getEvents(obj, 'onclick');

and will get the events in an array.

Any idea?

or Any function that I can use to "PAUSE" an event and "RESUME" later? e.g. I want to pause obj.click for a while untile somthing happen, then resume it. I don't want to remove all the events and register them back.
I know there is event stop propagation function, but that one cannot be resumed.

+3  A: 

Create something which hooks into addEvent or addEvent listener and then track it the additions/subtractions. But I wouldn't rewrite this, as jQuery already does it.

Here's the exact same question, but with all the answers:

http://stackoverflow.com/questions/446892/how-to-find-event-listeners-on-a-dom-node

(contains three methods of doing what you want)

altCognito
Thanks. Unfortunately, the code I'm working on is not using JQuery framework. It is using MochiKit. So, I'm stuck with looking for the more premitive type of solution.
Murvinlai
You can still select an answer or drop the question? :)
altCognito