jquery Learning Notes

Source: Internet
Author: User

01. The syntax for getting the first generation of child elements is the Parent>child selector

Example: Get the syntax for the span element of the first generation sub-element under all DIV elements is

$ ("Div>span")

02.id Selector #

03.class Selector.

04. The asterisk (*) selector, which gets all the elements of the page. "All"!!

05. If you want to select more than one specified element, you need to split it with ",".

$ ("Sele1,sele2,selen")

06.:first Picker Gets the first element

Example: Getting the first element in an LI tag

$ ("Li:fiirst")

The 07.:eq (index) selector, which gets the specified index element, which starts with the subscript 0.

$ ("Li:eq (3)"). CSS ("Background-color", "red")//change the background of the 4th Li element to red

08.:contains (String) selector, selecting all elements that contain string strings

09.:has (selector) selector with all elements of the specified element name in the selector

Example: Changing the background of the P tag under the LI tag

$ ("Li:has (P)"). CSS ("Background-color", "Blue");

jquery Learning Notes

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.