Home > Web Front-end > JS Tutorial > What are the grammatical structures of jQuery?

What are the grammatical structures of jQuery?

coldplay.xixi
Release: 2020-11-17 11:52:53
Original
3576 people have browsed it

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();].

What are the grammatical structures of jQuery?

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对象
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template