javascript – Ask element for their events – Education Career Blog

In JavaScript, is there a way to as a element for the events that I can use to add listener.

Something like:

element = document.getElementById(id);

I’m using a DOM example, but this would be useful in node.js also.


No, there is no such way of retrieving a list of supported events for an element/object.

In case of Node.js you should read the api documentation:

For HTML elements I would suggest that you search over at MDC, this should be a good starting point:

Leave a Comment