JQuery getting started tutorial (3): Selectors

Source: Internet
Author: User
JQuerySelector is a very important component of the jQuery library. JQuerySelector is used to select an HTML element. The basic statements of jQueryselector are the same as those of CSS Selector. All jQuerySelector start with $. Select HTML tag to select a... SyntaxHigh jQuery Selector, which is a very important component of the jQuery library. JQuery Selector is used to select an HTML element. The basic statements of jQuery Selector are the same as those of CSS selector. All jQuery Selector start with $. To select an HTML element, you can directly use the Tag Name of the element. For example, you can select all

Element [javascript] view plaincopyprint? $ ("P") $ ("p") the following example hides all

Element [javascript] view plaincopyprint? $ (Document ). ready (function () {$ ("button "). click (function () {$ ("p "). hide () ;}) ;}; $ (document ). ready (function () {$ ("button "). click (function () {$ ("p "). hide () ;}); # select jQuery for id selector to select the element that defines the id attribute. the id of the element on the webpage must be unique, you can use id to select a single unique element. For example, in the following example, When you click a button, only the element with the id as test is hidden. [Html] view plaincopyprint?

Related Article

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.