Properties/methods of common elements attr/val/html/text

Source: Internet
Author: User

Properties/methods of common elements
Gets the height of an element, $ ("#myid"). Height ()
Gets the position of an element, $ ("#myid"). Offset () Returns an offset object, if the top of the element position is taken, $ ("#myid"). Offset (). Top, and take left is $ ("#myid"). Offset (). Left
Get an element of innerHTML, $ ("#myid"). HTML ()
Get an element of innertext, $ ("#myid"). Text ()
Get the value of a text box, $ ("#myid"). Val ()
Gets the attribute of an element, $ ("#myid"). attr ("MyAttribute")

These methods have a basic feature, that is, without parameters to represent the value, with the parameter to indicate the SetPoint (in addition to offset), such as
$ ("#myid"). Height ("20″");
$ ("#myid"). HTML ("<a href=" >asdasd</a> ")
$ ("#myid"). Val ("ASDASD")

Properties/methods of common elements attr/val/html/text

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.