I have a quite simple question.
On jquery, a multiple selection, lets say $(“.class1, #id2”) select the elements as an “or” operator, since it will select all elemets with .class1 and all elements with #id2.
However, is there a way to make the selection an an “and” operator? in the example all elements that have both, class1 and id2 will be selected, but if it has only class1 or only id2, they must not be selected.
I know that only one element can have id2, however this is a general question, you can change id2 for anything you want, for example data-id
Try the following:
or by using
Attribute Equalsselector: