Possible Duplicate:
Difference between .on('click') vs .click()
When handling a click of a div whats the difference between using .on and .click :
$('#myDiv').on('click' , function(e) {
});
$('#myDiv').click(function(e) {
});
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.
Both are same…
.clickis internally going to call.onmethod.If you see the this part of jQuery source code.
You can see that all the methods are in turn going to call
.onmethod. So on will reduce your one level.This is the implementation of
.onin jQuery.