jquery Syntax Basics & Selectors

Source: Internet
Author: User

With jQuery, you can select (query) HTML elements and perform actions on Them.

JQuery Syntax Examples
$ (this). Hide ()
Demonstrates the JQuery hide () function, which hides the current HTML Element.
$ ("#test"). Hide ()
Demonstrates the JQuery hide () function, which hides elements of the id= "test".
$ ("p"). Hide ()
Demonstrates the jQuery hide () function, hiding all <p> elements.
$ (". test"). Hide ()
demonstrates the jQuery hide () function, hiding all elements of the class= "test".

JQuery syntax

The jQuery syntax is for the selection of HTML elements, and you can perform certain operations on Elements.

The underlying syntax Is: $ (selector). Action ()

    • Dollar sign definition JQuery
    • Selector (selector) "query" and "find" HTML elements
    • JQuery Action () performs an operation on an element
Example

$ (this). Hide ()-hides The current element

$ ("p"). Hide ()-hides all paragraphs

$ (". test"). Hide ()-hides all elements of class= "test"

$ ("#test"). Hide ()-hides all elements of the id= "test"

Tip: The syntax used by JQuery is a combination of XPath and CSS selector syntax. In the next chapters of this tutorial, you will learn more about selectors Syntax.

/*************************deom1**********************************/

/*************************deom2**********************************/

<! DOCTYPE Html>

 

/*************************deom3**********************************/

 

/*************************deom4**********************************/

<! DOCTYPE Html>

Introduction to the/************************* selector (CSS3 base is easy to Understand) *********************************/

"author": Walk Lightly 143
"source": http://www.cnblogs.com/qingqingzou-143/
"disclaimer": all post headings add (share) to the collection of outstanding articles from others, while the rest are Original. Welcome reprint, But please show this article link in the prominent position, and retain this paragraph statement, otherwise investigate legal liability, thank you!

jquery Syntax Basics & Selectors

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.