Today, the difference and transformation between a JavaScript object and a jquery object and a DOM object has been seen before, but the JavaScript object has been created before
var variable =//This is a JavaScript object
var $variable = $ ()//This is a jquery object
var variable = document.get ...//This is a DOM object, methods include getElementById (), Getelementbytagname () ...
So let's talk about the conversion between them:
The conversion between jquery and JavaScript objects
Conversion between jquery and Dom objects
jquery defines a DOM node as a method that calls the DOM first, and then transforms it into a jquery object
var $li = $ ("<li></li>") equal to the following
var $li = $ (document.createelement ("Li"))
Okay, that's almost it.
So the question arises in the mind, then what about the conversion between the DOM object and the JavaScript object???????
Let's talk about what DOM is for ...
Let's start with a W3 definition:
URL is: http://www.w3.org/TR/DOM-Level-2-Core/introduction.html
If you don't know English, look it up in the dictionary. , it says that the DOM is just an HTML and XML application interface that is used to manipulate nodes (element nodes, text nodes), not a language, just like JSON, which is just a tool.
I think:
It is to find the matching element by providing a method, and then return a corresponding object, typically, like document.getElementById () returns an object, while Document.getelementbytagname (), Document.getelementbyname () returns an array of objects that are loaded in an array. Different language platforms are available for it, which language to use, and which language to return to, which is the object of the language.
JavaScript objects and jquery objects and Dom objects