List of registered events
I have two questions to ask.
1. How do I check which events are registered with a specific element.
2. How do I check which event handler is registered with a specific event on an element.
Basically, what I'm trying to do is allow the user to add events on an element. This part I was able to do. But now, I would like to give them an option to be able to remove events. I know that I will have to use removeEventListener and detachEvent for this. But when the user tries to remove an event, I would like to check two things:
i) if that event is registered with this element
ii) if it is, then check if the provided function / event handler was registered with the given event
Please let me know if there's a better way to achieve this. Thanks so much in advance.