This article mainly introduces the basic syntax of jQuery. it analyzes jQuery objects and their operation usage in the form of examples, which has some reference value, for more information about jQuery basic syntax, see the following example. Share it with you for your reference. The specific analysis is as follows:
This syntax rule consists of two parts: getting jQuery objects and performing operations on jQuery objects.
The code is as follows:
$ (Selector). action ()
The preceding syntax rules are described as follows:
1. $ defines jQuery and converts the selected DOM object to a jQuery object.
2. selector is a selector, similar to a CSS selector.
3. action () is the operation on the row of the jQuery object.
Note: $ is short for jQuery. For example:
The code is as follows:
$ ("P ")
You can also write the following method, but we are used to writing the above method.
The code is as follows:
JQuery ("p ")
Instance code:
The code is as follows:
Foot home