The most important thing about jquery is the object jquery object is like a person who is an object
Object has property of object person: Name Age gender
The object has methods for the object's method: Eat, drink, walk.
How do I get a jquery object? You can use $ ('. Classnmae ') to make an element div a p or anything else into a jquery object as long as the page is imported into the jquery package.
Write a piece of code so that the person who drinks water will be very obedient to drink water
Code: Object. The point of drinking water is to call to execute a method
The same understanding in jquery $ (div) This is a jquery object Jqurey object There are many ways to have hide ()--Hidden method jquery object. Hide Method $ (div). Hide ();
jquery corresponds to hide and Show method $ (div). Show (); You can try it in the html.html.
The jquery object also has empty (); Empty the contents of a Div
The following code: Copy down and put in the. html file to run the Edit Test jquery tutorial Address: http://www.w3school.com.cn/jquery/jquery_syntax.asp
<!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd "><HTMLxmlns= "http://www.w3.org/1999/xhtml"Xml:lang= "ZH-CN"><Head> <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" /> <title>JavaScript Advanced Programming (3rd edition) pdf</title> <Metahttp-equiv= "Content-language"content= "ZH-CN" /> <Metahttp-equiv= "X-ua-compatible"content= "Ie=emulateie7" /> <Scriptsrc= "Http://libs.baidu.com/jquery/1.9.0/jquery.js"></Script></Head><Body> <P>In script, precede the code with//to indicate the line of code */* = comment a piece of code</P> <Divclass= "Test">Where the occurrence of the place Satan law</Div> <Script> //You can change the following to show (); try it. //you can also try empty (); method $ ('. Test '). empty (); $('. Test'). Hide (); </Script></Body></HTML>
It says what the object is, how to call the method, but the calling method can also have parameters such as how many people eat when they eat;
For example, the above example is changed to hide in 1 seconds
$ ('. Test '). Hide ($); $ ('. Test '). Show (1000);
Getting Started with jquery