What is the difference between onclick and .on('click') ?
Ans:
1) if i am using ajax with onclick or click and it is not working but when i am using .on('click'), it is working perfect.
2) .on(...) is new with Jquery and it will work with javascript or jquery.
3) preferring .on over .click because the former can use less memory and work for dynamically added elements.
No comments:
Post a Comment