I have several different tasks that may need some optimization:
$('.container').on('click', '.one', function () {
// do task one
});
$('.container').on('click', '.two', function () {
// do task two
});
$('.container').on('click', '.three', function () {
// do task three
});
Merged into the following:
$('.container').on('click', '.one, .two, .three', function () {
// How to selectively perform each task, based on the trigger/ selector?
// Think of if (event.type === 'mouseenter') // do sumthing
});
The question is how to selectively perform each different task, based on each trigger/ selector? Or is there a better way to perform this?
Thanks