jquery Learning Notes-selector-1

Source: Internet
Author: User

The $ () method in jquery is equivalent to the jquery () method, the former is more commonly used, and is shorthand for the latter. The jquery () method is typically used only when $ () conflicts with other languages.

The scope of the parent > child selector, the target of which is a subset of elements, the equivalent of a family of children, but does not include the grandchild, its invocation format: $ ("Parent > Child"), the children parameter gets the element is the parent selector of the sub-element , which represent a hierarchical relationship between them through the ">" symbol.

The Prev + next selector can look for the next "next" element immediately adjacent to the "prev" element, in the format: $ ("prev + next"),

Where the parameter prev is any valid selector, the parameter "next" is another valid selector, and the "+" between them represents an upper and lower hierarchical relationship, that is, the next element closest to the "prev" element is returned by the "next" selector and returns only one element.

The prev ~ Siblings selector finds adjacent elements after the Prev element, gets all adjacent elements behind the prev element, and calls the format: $ ("prev ~ siblings"), where the parameter prev and the siblings pass through "~" Symbols form a hierarchical, contiguous relationship that indicates that the elements acquired by the siblings selector are sibling elements after the Prev element.


This article is from the "theYllwRvrNo98" blog, make sure to keep this source http://yellowriver.blog.51cto.com/8753974/1673447

jquery Learning Notes-selector-1

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.