I am wondering if there is a way to have "OR" logic in jQuery selectors. For example, I know an element is either a descendant of an element with class classA or classB, and I want to do something like elem.parents('.classA or .classB')
. Does jQuery provide such functionality?
Use a comma.
'.classA, .classB'
You may choose to omit the space.