Introduction to common sets and get(({msg}}.html loops in jquery

Source: Internet
Author: User

Copy codeThe Code is as follows:
((”Msg”).html (); // return the html content of the element node whose id is msg.
Certificate (registry.msg;).html ("new content");
// Write "new content" as an html string to the element node content with the id of msg. the bold new content is displayed on the page.

$ ("# Msg"). text (); // return the text content of the element node whose id is msg.
$ ("# Msg"). text ("new content");
// Write "new content" as a common text string to the element node content with the id of msg. The page displays the new content

$ ("# Msg"). height (); // returns the height of the element whose id is msg.
$ ("# Msg"). height ("300"); // set the height of the element whose id is msg to 300
$ ("# Msg"). width (); // return the width of the element whose id is msg
$ ("# Msg"). width ("300"); // set the width of the element whose id is msg to 300

$ ("Input"). val ("); // return the value of the input box of the form.
$ ("Input"). val ("test"); // set the value of the form input box to test

$ ("# Msg"). click (); // trigger the click event of an element whose id is msg
$ ("# Msg"). click (fn); // click an event to add a function for an element whose id is msg

$. Each ([0, 1, 2], function (I, n) {alert ("Item #" + I + ":" + n );});
[Code]
It is equivalent:
[Code]
VartempArr = [0, 1, 2];
For (vari = 0; I <tempArr. length; I ++ ){
Alert ("Item #" + I + ":" + tempArr [I]);
}

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.