What is the difference between
$('.classname').on('click tap', function(){});
and in the second case there is an OR sign ('||') between the events
$('.classname').on('click || tap', function(){});
Both seem to work fine but I would really like to know if adding an OR sign in the second case makes a difference?
||
is not used as OR
in jquery binding. It bind custom event named ||
. Which can be triggered by:
$('.classname').trigger('||');
So, don't use it, if you don't need it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With