jquery dynamically changes the use of a bitmap's src and attr

Source: Internet
Author: User
Using jquery to dynamically change a bitmap of SRC found that CSS is not good to use and attr seems to be able to manipulate all attributes, including jquery not encapsulated attributes, specifically implemented as follows, interested friends can refer to the following

In jquery today, you want to dynamically change a bitmap of SRC found that CSS is not good to use, look at jquery documents as if CSS is the attribute of setting styles, such as color, font, background, and so on, and attr seemingly can manipulate all attributes, including jquery not encapsulated attributes.

Copy Code code as follows:
$ ("#newClassImg"). attr ("src", "./images/plus3.jpg");//Change Picture source
$ ("#newClass"). CSS ("Background-color", "#d6d6d6");//Change background color


Suggest a jquery Chinese document Inquiry website

Http://jquery-api-zh-cn.googlecode.com/svn/trunk/index.html

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.