how to retrieve onlick events added with click() [duplicate]
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.
精彩评论