开发者

Ask element for their events

In JavaScript, is there a way to as a eleme开发者_开发问答nt for the events that I can use to add listener.

Something like:

element = document.getElementById(id);
console.log(element.listEvents);

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:
http://nodejs.org/api.html

For HTML elements I would suggest that you search over at MDC, this should be a good starting point:
https://developer.mozilla.org/en/DOM/element#Event_Handlers

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜