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
"