jquery Learning Notes---the relationship between jquery objects and Dom objects

Source: Internet
Author: User

1.DOM (Document Object model). Dom Tree {html (head&&body), head (Meta && title), Body (H,p,ui), UL (Li ...)}

2.Jquery objects: JQuery objects are objects that are created after wrapping a DOM object through jquery, and jquery is unique to jquery.

3.JQuery objects and Dom objects are converted to each other.

Declare the style of the variable, DOM variable. such as: Var Variable=dom object;

jquery variable. such as: Var $variable =jquery object;

3.1 jquery objects are turned into DOM objects, there are two methods, [index] and get (index). Such as:

var $test = $ ("#test"); jquery Object

var test = $test [0]; Dom Object (Convert $testjquery object to DOM object, convert by [index] method)

var test1 = $test. Get (0); Dom object, (converts the $test object to a DOM object, implemented by the Get (index) method)

3.2 Dom objects are converted to jquery objects, using $ (DOM object) to convert.

var domtest = document.getElementById ("Domtest"); Dom Object

var $domTest = $ (domtest); jquery Object

jquery Learning Notes---the relationship between 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.