A simple introduction to jquery (i)

Source: Internet
Author: User

JQuery is a library of JavaScript

The advantages of jquery

► Lightweight (Lightweight) ► Powerful Selector ► EXCELLENT DOM operation Encapsulation ► Reliable event Handling ► Excellent browser compatibility

Use of jquery

► Download: http://jquery.com provides the latest jquery framework download. Usually just download the smallest jquery package (Minified). Currently the latest version of the Jquery-1.3.2.min.js file is only 55.9 kb► reference: ►<script src= "Jquery.min.js" ></script> after importing the jquery framework file, You can use jquery selectors and various function functions.

jquery Object

The ►jquery object is the object that is created after wrapping the DOM object through jquery ►jquery object is unique to jquery. If an object is a jquery object, then it can use the method in jquery: $ ("#tab"). html ();   The ►jquery object cannot use any of the DOM object's methods, nor can the DOM object use any of the methods in jquery ► Propose conventions: If you get a jquery object, precede the variable with $. §var$variable = jquery Object §var variable = DOM Object

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >  

jquery objects turn into DOM objects

The ►jquery object cannot use methods in the DOM, but if jquery does not encapsulate the method you want, you have to use the DOM method, as in the next two ways: ► (1) The JQuery object is an array object that can be obtained by means of the [index] method. ►$ ("#msg") [0]► (2) uses the Get (index) method in jquery to get the corresponding DOM object ►$ ("#msg"). Get (0) Dom object into jquery object

► For a DOM object, you can get a jquery object by wrapping the DOM object with $ () (the jquery object is the object created after wrapping the DOM object with jquery). For example: ►$ (document.getElementById ("MSG")) ► After conversion, you can use the method in jquery.

Use of jquery

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" > 
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >
Odd-even row discoloration

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" > Setting values and values for jquery

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" > Append and delete

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" > Focus and lose focus

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" > Bind events and Unbind events

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >
Delegation of events

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" > The animated effect of jquery

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >  







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.