Is there any difference between the following code?
$(\'#whatever\').on(\'click\', function() {
/* your code here */
});
and
.click
events only work when element gets rendered and are only attached to elements loaded when the DOM is ready.
.on
events are dynamically attached to DOM elements, which is helpful when you want to attach an event to DOM elements that are rendered on ajax request or something else (after the DOM is ready).