I have been searching around without finding an satisfying answer. What is the difference between the 2 following event-handlers.
$('#div').on('click', function(){
//do something
});
and
$('#div').click(function(){
//do something
});
I know that in the $('#div').on('click', function()
, you can send in more div or class-selectors in addition to 'click'
, but is that it?
I'd love to hear what else separates them, and if there are times where one is better to use than the other.
Thanks