开发者

how to retrieve onlick events added with click() [duplicate]

This question already has answers here: Closed 11 years ago. 开发者_StackOverflow社区

Possible Duplicate:

jQuery find events handlers registered with an object

How can you retrieve all onlick methods added with click()?


This will return an array of objects:

$(foo).data("events").click

Access the handler member to get the function:

$(foo).data("events").click[0].handler

JSFiddle: http://jsfiddle.net/Q7hdz/


From the docs:

jQuery itself uses the .data() method to save information under the names 'events' and 'handle'...

So Alnitak's warning below may apply.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜