2016/4/1 jquery and JavaScript ① take elements ② action content ③ action Properties ④ operation style

Source: Internet
Author: User
Tags tag name

The min version of jquery is the same as the original function , and themin version is mainly used in Web pages that have already been developed , not the Min version.
The file is large , there are neat code writing specifications and comments , mainly used in the script development process .

jquery is another excellent JavaScript library following prototype. It is a Lightweight JS library , it is compatible with CSS3
, also compatible with various browsers (IE 6.0+, FF 1.5+, Safari 2.0+, Opera 9.0+), jQuery2.0 and later
The Ie6/7/8 browser will no longer be supported by the continued version. jquery enables the user's HTML page to keep the code and HTML content separate
, that is, you do not have to insert a bunch of JS in the HTML to invoke the command, only need to define the ID.

jquery is a multi-browser-compatible JavaScript library, with the core concept of write less,do more (write less,
Do more). jquery is free, open source, and uses the MIT license Agreement.

JQuery, as its name implies, is JavaScript and query, which is a library of auxiliary JavaScript development.

1, introducing jquery

1 <! DOCTYPE html> 2  3  4     <meta charset= "UTF-8" > 5     <title>Document</title> 6  7 <!--introducing jquery-- 8 <script src= " Jquery-1.11.2.min.js "></script> 9  12       </body> 

① elements: JS mode and jquery mode

1<! DOCTYPE html>234<meta charset= "UTF-8" >5<title>Document</title>6 7<!--introducing jquery--8<script src= "Jquery-1.11.2.min.js" ></script>9 Ten One<body> A  -<div id= "DV" > First div</div> -  the<divclass= "V" > Second div</div> -<divclass= "V" > Third div</div> -<divclass= "V" > Fourth div</div> -  +<input type= "text" name= "UID" > -  +</body> A<script type= "Text/javascript" > at     //First, JS mode: -  - //①js takes elements and takes out concrete element objects - //1, according to the ID to take - //alert (document.getElementById ("DV")); - //2, based on class in //alert (Document.getelementsbyclassname ("V")); - //3, Collection is a collection based on the tag name to //Alert (document. getElementsByTagName (' div ')); + //4, the nodelist array is found by name - //Alert (document.getelementsbyname (' uid ')); the      *      $ Panax Notoginseng  - //Two, jquery way the  + //①jquery takes the element and takes out the jquery object A$ (document). Ready (function(e) { the         //1, according to the ID to take + //alert ($ ("#dv")); - //2, based on class $ //alert ($ (". V")); $ //Loop output is the element that is taken from the subscript, and the EQ takes out the object - //Var v=$ (". V"); - //For (var i = 0; i < v.length; i++) { the //Alert (V.eq (i) [0]); -         // }Wuyi //3,object The object to be found based on the tag name the //alert ($ ("div")); - //4, depending on the attribute, any attribute of the object can be taken as such. Wu //alert ($ ("[Name=uid]")); -  About  $  -  -     }) -</script> A

② Operation Content

2016/4/1 jquery and JavaScript ① take elements ② action content ③ action Properties ④ operation style

Related Article

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.