JQuery () parameter

Source: Internet
Author: User

An alias for jquery is $, and there's no doubt about it.

$ ("div"), get all the DIV elements, no problem;

$ ("div", $ ("Div. SomeClass")), this is a more general, but I miss the method;

JQuery (Expression,[context])

expression, as a selector;

Context, optional, if not set, the current DOM as the context, or, if set, the result set of the selector as an expression.

The following code is the code in the jquery combat, meaning to look for the first div in the parent element of this, and then use this div as the 'div' context to get into the div ' Div'

$ (' div ', $ (this). Parents (' Div:first '))

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.