Css/jquery element selector && and | |, selector logic operation

Source: Internet
Author: User

When using CSS or jquery to select elements. Very often we need to make a && or | | Operation.


jquery or CSS | | Operations are often used. Also very easy, is separated by commas.

Selector1,selector2,selectorn
For example, if we want to select a div or span, we can select the element that satisfies the condition by $ ("Div,span").


&& in CSS or jquery. Most of what I've seen is done in class, and I don't know if it's just that way.

. ClassName1.className2.classNameN
For example, if we want to select a div, which must have the 2 classes of Lily and Lucy, it can be selected by the. Lily.lucy.


Unique && operations in jquery, not limited to class attributes, are more flexible

[Selector1] [Selector2] [Selectorn]
For example we want to select a div, the class of this div is Angle,id is aty_id, then can use $ ("div[id= ' aty_id '][class= ' age ']")

Css/jquery element selector && and | |, selector logic operation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.