How to find event handlers on an object in jQuery 1.8+?
var func = function(){ alert(1); };
var obj = $('#obj');
obj.on("click", func);
// obj.data('events') is undefined
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use the data function as is done by jQuery internally.
On previous versions, you could call it like for other data :
In jQuery 1.8, this direct access was removed, so in recent versions you must call it like this :
You can see it in action by opening the console in this fiddle : http://jsfiddle.net/8TpeP/2/