The syntax structure of jQuery mainly includes three parts: [$()], document and [ready()], and selector. Among them, document and [ready()] are called factory functions respectively, and the syntax is: [$(selector).action();].
Recommended: "jquery video tutorial"
1. The syntax structure of jQuery
jQuery The statement mainly contains three parts: $(), document and ready() are called factory functions, selectors, respectively.
Syntax: $(selector).action();
2. Nodes in DOM are usually divided into three types: element nodes, text nodes, and attribute nodes
3. To add styles to DOM elements, you can use addClass()
Method and css()
method
4. Use the next()
method to obtain the immediately adjacent sibling elements of each element in the matched element set
5. Conversion between DOM objects and JQuery objects
var txtName=document.getElementById("txtName"); //DOM对象 var $txtName=$(txtName); //jQuery对象
Related free learning recommendations: JavaScript (video)
The above is the detailed content of What are the grammatical structures of jQuery?. For more information, please follow other related articles on the PHP Chinese website!