Common set and get$ ("#msg") in jquery. Introduction to HTML Loops _jquery

Source: Internet
Author: User
Copy code code as follows:

$ ("#msg"). html ();//returns the HTML content of the element node with MSG ID.
$ ("#msg"). HTML ("new content");
//writes "New content" as an HTML string to the element node content with the ID msg, the page displays bold new content

$ ("#msg"). Text ();//returns the textual content of the element node with the ID MSG.
$ ("#msg"). Text ("New content");
//writes "New content" as a normal text string to the element node content with the ID msg, the page displays the new content

$ ("#msg"). Height ();//Return the level of the element with ID MSG
$ ("#ms G "). Height (" 300″ "); Set the height of the element with the ID msg to
$ ("#msg"). width ();//Returns the breadth of the element with the ID MSG
$ ("#msg"). Width ("300″); Set the width of the element with the ID msg to

$ ("input"). Val ("); Returns the value
$ ("input") of the form's input box. Val ("Test"); Set the value of the form's input box to test

$ ("#msg"). Click (); br>$ ("#msg"). Click (FN); Click the event add function for the element with MSG ID

$.each ([0,1,2], function (i, N) {alert ("Item #" + i + ":" + N);});
[code]
is equivalent to:
[code]
vartemparr=[0,1,2];
for (vari=0;i<temparr.length;i++) {
Alert ("item#" +i+: "+temparr[i]);
}

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.