DOM objects: Dom (Document Object model), each DOM can be represented as a tree, DOM objects can use the methods in JavaScript.
jquery objects: jquery objects are objects that are produced after wrapping a DOM object through jquery. jquery objects are unique to jquery.
Dom objects and jquery objects cannot use each other's methods with each other, after conversion.
1. jquery objects into DOM objects
You can use the DOM object's method after you turn the jquery object into a DOM object. There are two types of conversions, [index] and get (index).
(1). The jquery object is an array-like object that can be obtained using the [index] method of the corresponding DOM object.
The jquery code is as follows:
var // jquery Object var cr= $cr [0]; // DOM Object
alert (cr.checked); Detects if the checked is selected
(2). Get the corresponding DOM object through the Get (index) method, which is provided by jquery itself.
var // jquery Object var cr= $cr. Get (0); // DOM Object alert (cr.checked); // detects if the checked is selected
2. DOM objects converted into jquery objects
After you convert the DOM object to a jquery object, you can use the method in jquery.
As long as you wrap the DOM object with $ (), you get a jquery object in the form of: $ (DOM), as shown here:
var cr = document.getElementById (' cr '); // DOM Object var $cr = $ (CR); // jquery Object
Knowledge points: The usual jquery objects are created by the $ () function, and the $ () function is a manufacturing facility for jquery objects.
Mutual conversions between jquery objects and Dom objects