Just touching jquery this week, indeed, doing the most things with the least amount of code, we just write a few lines of code to achieve amazing results. There is no need to worry too much about browser differences, even in IE this is a more special and disgusting browser can be very good compatibility, do not worry about your DOM operation will not be supported under IE problems.
It can not only manipulate the DOM, but also can implement animation, events and other processing. It is also a chained operation, that is, a set of actions on the same jquery object that can be ligatures directly without having to retrieve the object repeatedly. This can save a lot of code for us. And it's open-source, and anyone can use it freely.
such as: document.getElementById ("mydiv"). Value;
The implementation in jquery is $ ("#myDiv"). Val (); Simple, rough, easy to use!
However, if you need to convert between the DOM and jquery operations, you need to convert between the two, as follows:
var $CR = $ ("#cr")--var cr = $CR [0]; Or: var cr = $CR. get[0] This is the transition from jquery to DOM operation.
var Cr=document.getelementbyid ("Cr")---Var $cr =$ (CR); This is the transition from DOM to jquery.
The selection of common HTML elements
$ ("xxx")--all <xxx> tagged elements $ ("P#demo")--All Id= "demo" <p> Elements $ ("P.style")--all class= " Style "<p> element $ (" #demo ")--All Id=" demo "Elements $ (". Style ")--all class=" style "elements