I would like to test the element object to see if it has "classA" or "classB". For example, the click () event returned an element in the property of the target event. I want to check this element to see if it has one of these two classes.
$("#mybutton").click(function($event) { var $el = $($event.target); if($el.is(".classA") || $el.is(".classB")) {
As above, using the is() function, I can check each class separately, but I'm curious if I can do this with one function call instead of two?
ingredient_15939
source share