2 of jquery's weapons

Source: Internet
Author: User
Tags jquery library

<!--
$ is a function, the first is to add $ to the window, then the value is a function, the value returned by the function is the object.
1. jquery Core function
* Abbreviation: jQuery function ($/jquery)
* The JQuery Library is directly exposed to $/jquery
* After the introduction of the jquery library, directly use the $
* When function with: $ (XXX)
* When objects are used: $.xxx ()
2. JQuery Core Objects
* Abbreviation: jquery object
* Get jquery object: The jquery object is returned by executing the jquery function
* Use jquery object: $obj. XXX ()
-

<!DOCTYPE HTML><HTML>    <Head>        <MetaCharSet= "UTF-8">        <title>01_ initial jquery</title>        <Scripttype= "Text/javascript">window.onload= function() {btn1=document.getElementById ("BTN1"); Btn1.onclick= function(){                    varusername=document.getElementById ("username"). Value; Alert (username)}}</Script>        <!--using jquery to implement -        <Scripttype= "Text/javascript"src=".. /.. /js/jquery-1.10.1.js "></Script>        <Scripttype= "Text/javascript">            //1\ using the JQuery core function ($,jquery)            //binding Document loading complete listening is just as spicy as Window.onload's effect. $ (function () {})                            $(function(){                $("#btn2"). Click (function(){                    varusername= $("#username"). Val ();//binding monitoring to BTN2alert (username)}) })            /** JQuery Core Object * Executes $ () object returned * The jquery object will be preceded by a $*/        </Script>    </Head>    <Body>        <!--need: Click "OK" button, prompt for the value of the input -User name:<inputtype= "text"ID= "username" >        <ButtonID= "BTN1">Ok (native version)</Button>        <ButtonID= "BTN2">Ok (jquery edition)</Button>    </Body></HTML>

2 of jquery's weapons

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.