Version 1.4.2.
Download http://www.jquery.com
Let me talk about use often of jquery's methods.
Core ..
1. jquery (arguments [0], arguments [1]); <br/> find arguments [0] In arbuments [1]. like. jquery ("TR", "table"); </P> <p> 2. jquery (element (s); <br/> conversion a object to jquery object. like jquery (document. body); </P> <p> 3. jquery (string); <br/> by the String Conversion a string to a jquery object. like jquery ("body ");
Bind event ..
1. <br/> $ ("TR", $ ("table ")). each (<br/> $ (this ). live ("hover", function () {<br/> $ (this ). toggleclass ("C"); <br/>}); </P> <p>); </P> <p> 2. <br/> $ ("table "). each (<br/> $ ("TR", this ). live ("hover", function () {<br/> $ (this ). toggleclass ("C"); <br/>}); </P> <p>); </P> <p> 3. <br/> $ ("table "). find ("TR "). each (function () {<br/> $ (this ). hover (function () {<br/> $ (this ). toggleclass ("C"); <br/>}); </P> <p> 4. <br/> execute one time. <br/> $ ("body "). one ("click", function {}{}); </P> <p> 5. $ ("table "). delegate ("TD", "hover", function () {<br/> $ (this ). toggleclass ("C"); <br/>}); </P> <p> Find object... <br/> 1. find by ID. <br/> $ ("# ID"); </P> <p> 2. find the tr child elements of table. <br/> $ ("table "). find ("TR"); </P> <p> 3. find the first tr child element of table. <br/> $ ("table "). find ("TR: eq (0 )"). or $ ("table "). ("TR: First"); </P> <p> 4. find the tr parent element of table. <br/> $ ("TR: parent ");
Attributes...
1. find a div which has ID attributes. <br/> $ ("Div [ID = 1]"). id equals 1. </P> <p> $ ("Div [name = big]"). name equals big.
Form...
1. find a input which type is radio. <br/> $ (": input [type = radio]"); </P> <p> 1. find all checkboxes which it was be checked. <br/> $ ("input: checked ");
CSS...
1. change style by CSS method. <br/> $ ("Div "). find ("span [ID = CSS]" ground .css ("background-color", "Red"); </P> <p> 2. change style by styling. <br/> $ ("Div "). addclass ("seleted"); </P> <p> 3. remove style. <br/> $ ("Div "). removeclass (); or $ ("Div "). removeclass ("seleted ");
Ajax ..
1. get method <br/> $. get (URL, {}, callback (RDATA) {}); </P> <p> 2. POST method <br/> $. post (URL, {}, callback (RDATA) {}); </P> <p> 3. return JSON data method <br/> $. getjson (URL, {}, callback (RDATA) {}); <br/>
Plugin...
(Function ($) {}) (jquery );