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