Dom:document Object Model
jquery object: The object that is produced after the DOM object is wrapped by jquery, the jquery object can use the method in jquery and cannot use any method of the DOM object.
Conversion of jquery objects and Dom objects
1. jquery converted to DOM object
var $variable =jquery Object
Var Variable=dom object
jquery provides two ways of [index] and get (index)
var $cc =$ ("#cc");
var cc= $cc [0]/$cc. Get (0);
2. Dom converted to jquery object
var Cc=document.getelementbyid ("CC");
var $cc =$ (CC);
<!--Dom Way to determine-- <script type= "Text/javascript" >//$ (function () {//var cc=$ ("#cc") [0];//$ ("#cc"). Click (function () {//if (cc.checked)//{//Alert ("Completed,thank You"),//}//else//{//alert ("Please read the details car Efully ")///}//});</script><!--jquery way to determine--><script type=" text/javascript ">$ (function () {$ ("#cc"). Click (function () {var $cc =$ ("#cc"), if ($cc. Is (": Checked")) {alert ("Jquery:completed,thank You");} Else{alert ("Jquery:please read the details carefully");}) </script>
<div> <input type= "checkbox" id= "cc"/> <label for= "CC" >i has read the above Terms</label ></div>
Resolve JQuery and other library conflicts: Jquery.noconflict () function to give control of variable $ to other JavaScript libraries
Dom Objects and jquery objects