Getting Started with jquery

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.