jquery Objects and Dom objects

Source: Internet
Author: User

1 What is jquery?

jquery is a package of JS, the underlying code is written in the JS code. It encapsulates a lot of methods and properties that we can use directly, without having to worry about how others are implemented, just by learning to call.

2 Why study jquery?

First, the native JS code has several disadvantages:

A: Compatibility issues

B: More repetitive code

C: Poor fault tolerance

The method name provided by D:dom is too long and easy to write wrong

The advantages of jquery:

A: Lightweight (file is small)

B: The DOM operation is encapsulated, simple to operate

C: Support chain-type operation

D: Support for rich plugins

E: Ajax Support

.....

jquery version?

There are currently 3 large versions of 1.x 2.x 3.x

Version 1.x supports IE6, 7, 8

2.x 3.x version does not support IE6, 7, 8

3: What is a jquery object and what is a DOM object?

jquery object: The element that is obtained through the jquery method is the jquery object

Dom object: The element obtained by the JS method is the DOM object

Note: jquery objects cannot use the properties and methods of Dom objects

DOM objects cannot use the properties and methods of jquery objects

4:jquery objects and DOM objects convert to each other?

A:dom object to jquery object?

var Odiv=document.getelementbyid (' Div1 ');

var jquery object =$ (Odiv);

B:jquery object to Dom object?

1:var odiv=$ (' div ') [0];

2:var odiv=$ (' div '). Get (0);

jquery Objects and Dom objects

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.