Dom object:
Document Object model, which can be represented as a tree by each part of the DOM.
As shown, the code is omitted
In this DOM tree, H3, P, UL, and UL's 3 Li subnodes are all DOM element nodes.
Get DOM object:
// get DOM Object var domobj = document.getElementById ("ID"); // using the JavaScript method var objhtml = domobj.innerhtml;
jquery object:
jquery objects are unique to jquery and are obtained by wrapping DOM objects in jquery.
// jquery method $ ("#foo"). html (); // equivalent to document.getElementById ("foo"). InnerHTML;
jquery object and Dom object transformations:
Jquery->dom:
The 1.jQuery object is an array object that can be obtained by [index] the corresponding DOM object
// conventions The jquery object's variables begin with $ to avoid confusion var $cr = $ ("#cr"//jquery object var cr = $CR [0]; // DOM Object alert (CR.checked); // detects if the checkbox is selected
2. Get the DOM object through the jquery method get (Index).
// conventions The jquery object's variables begin with $ to avoid confusion var $cr = $ ("#cr"//jquery object var cr = $cr.Get( 0); // DOM Object alert (CR.checked); // detects if the checkbox is selected
Dom->jquery:
For a DOM object, the DOM object is wrapped up by $ () as a jquery object.
var cr = document.getElementById ("cr"); // DOM Object var $cr = $ (CR); // jquery Object
Finally, again, DOM objects can use methods in the DOM, and jquery objects cannot use the methods in the DOM.
Sharp Jquery-1--jquery objects and Dom objects as well as mutual conversions