1. Conversion between DOM objects and jquery objects
<HTML> " Content-Type " Content = " Text/html; charset = UTF-8 " > <SCRIPT type = " Text/JavaScript " Src = " Jquery-1.3.1.js " > </SCRIPT> " Text " Id = " Test " Value = " Test " > <Input type = " Button " Value = " Submit " Onclick = " Testing () " > <SCRIPT type = " Text/JavaScript " > // Pure js method VaR Obj1 = Document. getelementbyid ( " Test " ); Function Testing (){ VaR Obj1 = Document. getelementbyid ( " Test " ); Window. Alert (obj1.value );} // For a jquery object, specify that the name of a jquery object starts with $. VaR $ Obj2 = $ ( " # Test " ); Window. Alert ($ obj2.val ()); // Output Test // Dom-> jquery object /* $ (Document). Ready (function () {var $ obj3 = $ (obj1); // obj3 is the jquery Object window. Alert ($ obj3.val ());}); */ // Jquery-> DOM object // There are two methods. 1. $ (Document). Ready (function (){ // The first method is to treat an object as a set in jquery development. // VaR obj4 = $ obj2 [0]; // Obj4 is a DOM object. // Method 2 VaR Obj4 = $ obj2. Get ( 0 ); Window. Alert (obj4.value ); // Output Test }); </SCRIPT> </body>