jquery traversal Array Each method is detailed _jquery

Source: Internet
Author: User
Tags button type getscript tagname

The way jquery takes objects

$ (' #id '): Through the ID of the element

$ (' TagName '): Through the label name of the element

$ (' TagName tagName '): By the label name of the element, eg: $ (' ul Li ')

$ (' Tagname#id): ID and label signature of element

$ (': CheckBox '): Takes all elements of the input type checkbox ':

Eg:

<input type= "checkbox" Name= "appetizers"

 value= "Imperial"/>

$ (' span[price] input[type=text] ') : Fetch the following INPUT element

<span price= "3" >
<input type= "text" name= "imperial.quantity" disabled=
         " Disabled "value=" 1 "/>
</span>

$ (' div ', $ (this). Parents (' Div:first ')) : Take the first div node of the DIV (at least the parent node)

$ (' ~ Span:first ', this): Locates the "a" and "s", "a <span> element.

Delay Loading JS file:

$.getscript

Example:

HTML file:

Java code

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01//en" "HTTP://WWW.W3.ORG/TR/HTML4/STRICT.DTD" >
 
 

JS file:

Java code

Alert ("I ' m inline!"); 

var somevariable = ' Value of somevariable '; 

function SomeFunction (value) { 
alert (value); 
} 

function test () { 
alert (' Test '); 
}

Alert ("I ' m inline!");

var somevariable = ' Value of somevariable ';

function SomeFunction (value) {
alert (value);
}

function test () {
alert (' Test ');
}

jquery Array Processing:

Java code

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01//en" "HTTP://WWW.W3.ORG/TR/HTML4/STRICT.DTD" >  

Above this jquery traversal array each method is a small series to share all the content, hope to give you a reference, but also hope that we support cloud habitat community.

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.