Some differences about the HTML element and Javascript/jquery object

Source: Internet
Author: User

Recently, when invoking the GetContext ("2d") method of the HTML canvas, it was found that a canvas constructed with JS's document.createelement ("canvas") could be called directly, while using jquery Constructor $ ("<canvas>") constructs a canvas that requires Canvas[0].getcontext ("2d") to invoke

Understanding some of the differences between the HTML element and Js/jquery object, it turns out that the DOM Element,ex:<div> is constructed using Document.createelement; <a> But using jquery constructor constructs a new object (container), as a array,array contains element, and the following is Console.log () to get the difference:

Find yourself a lot of direct hack to use, and some places are not clear, there are a lot of places to learn

Reference:

Https://www.quora.com/What-is-the-difference-between-a-raw-DOM-element-and-a-JavaScript-jQuery-object

Https://stackoverflow.com/questions/6942193/whats-the-difference-between-a-jquery-object-and-a-dom-element-difference-betw

Some differences about the HTML element and Javascript/jquery object

Related Article

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.