jquery Tutorial: The core of jquery

Source: Internet
Author: User
Tags html page

Please do not look at my source code, to see if the use of JS can be done

Example
Requirements:
1) page on the previous button;
2 After clicking the pop-up window, I was clicked;


The following figure:


The JavaScript code is as follows:




    1. Example 1





However, jquery is similar to this, but the HTML page does not need to fill in the onclick= "Myclick ()" Event Invoke Myclick () method, only to introduce the JQuery class library and its own jquery code.
Here is my jquery code implementation of the above diagram method

After reading the jquery example above, we can find that in fact we do not have to write in the HTML page, just introduce the relevant JS file can, so that the advantages can make our HTML page more simple, do not need to interspersed with complex JS code, so that the page and the perfect separation of the script, is not very magical?

Note: Examples of joined the charset= " GB2312 "is to enable it to display Chinese correctly because jquery is UTF-8 encoded.

students may ask what the "$" symbol in Demo1.js means. Kwooshung suggest that we don't underestimate it yo ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ because the core functions of jquery are implemented through this function, the jquery code written in the future is built on this function, simply put But why is it a function, obviously just a symbol ah?

in this case, I have abbreviated the code, their relationship is as follows, case-sensitive:

$ equivalent to jquery
$ (document). Ready () is equivalent to jquery (document). Ready ()
Their meaning in the example is equivalent to the JS
OnLoad () method
Click () indicates a mouse click event that will be explained in detail in the future


In this lesson, you only need to understand what the "$" symbol is OK, in the back of the study you will gradually become familiar with him ~
Well, isn't it interesting?


"Jobs"
1, in the page using CSS to define a long width is 100px div red area
2, the mouse clicks this red area, the pop-up dialog box, as to the dialog box what content casually.


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.