I have this:
$('#MyDiv1').on({
mouseenter: function () { SomeFunction(); },
mouseleave: function () { SomeOtherFunction(); }
}, '.SomeClass');
$('#MyDiv2').on({
mouseenter: function () { SomeFunction(); },
mouseleave: function () { SomeOtherFunction(); }
}, '.SomeClass');
Basically, the handlers are the same for both MyDiv1 and MyDiv2.
How do I combine them into one handler for both?
Thanks.
1 Answer