Home > Web Front-end > JS Tutorial > body text

Getting started with jQuery basic syntax examples_jquery

WBOY
Release: 2016-05-16 16:24:57
Original
886 people have browsed it

The examples in this article describe the basic syntax of jQuery. Share it with everyone for your reference. The specific analysis is as follows:

This syntax rule consists of two parts: getting the jQuery object and performing operations on the jQuery object.

Copy code The code is as follows:
$(selector).action()

The following is a detailed explanation of the above grammatical rules:
1.$Define jQuery and convert the selected DOM object into a jQuery object.
2.selector is a selector, similar to CSS selector.
3.action() is the operation to be performed on the jQuery object.
Note: $ is the abbreviation of jQuery. For example:
Copy code The code is as follows:
$("div")

can also be written in the following way, but we are accustomed to writing it in the above way.

Copy code The code is as follows:
jQuery("div")

Example code:

Copy code The code is as follows:






Script Home









In the above code, clicking the button can hide the div.

I hope this article will be helpful to everyone’s jquery programming design.

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