CSS/JQuery element selector & |, logical operations of selector, cssjquery Selector
When using CSS or JQuery to select an element, we often need to perform the & or | operation on the condition.
| In JQuery or CSS is very common and very simple. It is separated by commas.
Selector1, selector2, selectorN
For example, if you want to select div or span, you can use $ ("div, span") to select elements that meet the conditions.
Most of the & in CSS or JQuery I have seen are implemented using class. I don't know if this is the only method.
. ClassName1.className2. classNameN
For example, if we want to select a div, which must have the class lily and lucy, we can use. lily. lucy to select it.
Special & Operations in JQuery are not limited to class attributes, but more flexible
[Selector1] [selector2] [selectorN]
For example, if we want to select a div, the class of this div is angle, and the id is aty_id, you can use $ ("div [id = 'aty _ id'] [class = 'age']")