jquery binding same event to 2 selectors -
i have 2 classes: class1 , class2.
for now, have 2 function calls calling same myfunction function:
$('.class1').click(function () { myfunction() }); $('.class2').click(function () { myfunction() });
how rewrite "when there's click on class1 , on class2 call myfunction".
thanks.
$('.class1, .class2').click(function () { myfunction() })
Comments
Post a Comment