The jquery starter Tutorial: Capturing jquery objects

Source: Internet
Author: User
Tags final

Article Introduction: jquery into the comrades, through the first two chapters of the study, we must be in jquery "$" function is unclear, it does not matter, as long as we stand, we will be able to win the final victory. To get to the bottom, through the following chapters of the study, you will be able to understand the "$" function, trust me! Now let's think about what kinds of selectors are there in CSS?

jquery into the comrades, through the first two chapters of the study, we must be in jquery "$" function is unclear, it does not matter, as long as we stand, we will be able to win the final victory. To get to the bottom, through the following chapters of the study, you will be able to understand the "$" function, trust me!
Now let's think about what kinds of selectors are there in CSS?

Universal selector: *
ID selector: #element
Class selector: . Element
Tag Selector: element

This is also true for jquery object acquisition, as follows:

$("*")
Means get all the objects




$ ("#element")
equivalent to document.getElementById ("element");




$ (". ABC")
represents the acquisition of all elements in HTML that use the style of ABC




$ ("div")
Represents getting all the DIV elements in HTML




The following two kinds of is the acquisition of hierarchical objects, belong to the content of the next class, the next class no longer focus on explaining

$ ("#a,. b,p")
The element
that gets the ID is a and the element that uses class style B and all the P elements




$ ("#a. B P")
indicates that all of the P elements in the B element with a class style are included in the element with the id "a
"

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.