Introduction to the differences between val and atrr ("value") values assigned by jQuery _ jquery

Source: Internet
Author: User
In jQuery, val and atrr (value) are different for browsers. If val () is assigned with a default value, when this value is modified, google cannot obtain the latest value. However, when ie can be used as a project, the data I pass from the background is assigned a value to a text box. In the google browser,

No modification was found during the modification, and the reason was finally checked. It turns out that val and atrr ("value" in jQuery are different from those in browsers,

The summary is as follows:
In jquery, val () and atrr ('value' are used. If there is a default value, if val () is used to assign a value, when this value is modified, google cannot obtain the latest value, but ie can,
For atrr ('value', if there is a default value, ie and google can get the latest changes when it is worthwhile to change this value. Currently, tests are conducted on ie and google, and tests are not performed on other browsers. Haha

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.