jquery Tutorial: Selecting a child element under the parent

Source: Internet
Author: User

Article Introduction: So far , I have written the jquery tutorial has reached the eighth chapter, I do not know if you are still relatively unfamiliar with jquery, if you are still unfamiliar, it doesn't matter. CSS Learning Network in the back of the tutorial left behind the work or case, hope that friends can seriously complete the work of the case. I am sure that you will be able to manage this boisterous well.

So far , I have written the jquery tutorial has reached the eighth chapter, I do not know if you are still relatively unfamiliar with jquery, if you are still unfamiliar, it doesn't matter. CSS Learning Network in the back of the tutorial left behind the work or case, hope that friends can seriously complete the work of the case. I am sure that you will be able to manage this boisterous well.

This lesson is relatively simple, with four functions.

$ ("Element: Nth-child (index)")
Select the nth child element under the parent, and the index starts at 1, and the EQ function (the EQ function learns later) starts at 0.
┣━:nth-child (even) Even
┣━:nth-child (Odd) Odd
┣━:nth-child (3n) An expression
┣━:nth-child (2) Index
┣━:nth-child (3n+1) An expression
┗━:nth-child (3n+2) An expression

$ ("Element: First-child")
Match the first child element under the parent




$ ("Element: Last-child")
match the last child element under the parent




$ ("Element: Only-child")
matching a unique child element under the parent, such as DT in the DL list, will select DT


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.