Differences between jquery layered selector siblings and nextAll

Source: Internet
Author: User
The jquery hierarchy selector includes siblings and nextAll. This article describes how to use it. For more information, see. I hope to help you with the HTML code:

The Code is as follows:



1



2

2_1

2_1_1



2_2



3


4



$ (". One p" ).css ("background", "red") // All DIV descendant elements after. one (descendant: son and grandson .....)
$ (". One> p" ).css ("background", "red") // subelement after. one. (Son: son and daughter ....)
$ (". One + p" ).css ("background", "red") // adjacent elements after. one. It is the sibling element after. one. Only one
$ (". One" character .next(character .css ("background", "red") // This function is the same
$ (". One ~ P "background .css (" background "," red ") // sibling element after. one. Excluding the previous
$ (". One" ).nextAll().css ("background", "red") // same as above
$ (". One" ).siblings().css ("background", "red") // all the sibling elements of. one, either behind or before.

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.