The 14th chapter of the "Python Road"--jquery

Source: Internet
Author: User

About jquery

What is 1.jquery ? ? Reference usage

  • created by American John Resig , JQuery has attracted many JavaScript gurus from around the world to join its team.

  • JQuery is another excellent Javascript framework following prototype . Its purpose is to --write less,do more, write less code , and do more things.

  • It is a lightweight JS library ( only 21k after compression ) , this is not the other JS Library, it is compatible with CSS3, also compatible with a variety of browsers (IE 6.0 +, FF 1.5+, Safari 2.0+, Opera 9.0+).

  • JQuery is a fast, concise JavaScript Library that makes it easier for users to work with HTML documents,events, animate, and provide easy access to the site AJAX Interaction.

  • One of the big advantages of jQuery is that its documentation is full, and the various applications are very detailed, as well as a number of mature plugins to choose from.

  • JQuery allows the user's HTML page to keep the code and HTML content separate, that is, there is no need to insert a bunch of JS in the HTML to invoke the command, just define ID .

2. What is a jQuery object?

    • JQuery objects are objects that are produced after wrapping a DOM object through JQuery.

    • JQuery the object is unique to JQuery . If an object is a jquery object , then it can use the method in jquery : $ ( "#test"). html ();

Like what:

$("#test").html()This means: Gets The HTML code within the element with ID test . where html () is the method in jQuery

This code is equivalent to implementing the code with the DOM : document.getElementById(" test ").innerHTML;

although jQuery The object is produced after wrapping DOM jQuery Span class= "S3" > cannot use DOM DOM object also cannot use jQuery . error

Convention : If you get a jQuery object , precede the variable with $.

var $variable = jQuery对象

var variable = DOM对象

Two search elements (important selectors and filters)

2.1 Selector

2.1.1 Basic Selector

$ ("*") $ ("#id") $ (". Class") $ ("element") $ ("  . Class,p,div")       //Each selector is matched to the element that is merged and returned together.

  

  

The 14th chapter of the "Python Road"--jquery

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.