Changing the img src using jQuery

Posted by geekorama on Stack Overflow See other posts from Stack Overflow or by geekorama
Published on 2009-02-16T19:23:59Z Indexed on 2010/04/08 19:53 UTC
Read the original article Hit count: 220

Filed under:
|

Hi,

My DOM looks like this:

<div id="d1">
   <div class="c1">
            <a href="#"><img src="img1_on.gif"></a>
            <a href="#"><img src="img2_on.gif"></a>
   </div>
</div>

When anyone clicks on an image, I want the image src to change to where x represents the image number 1 or 2.

Is this possible or do I have to use CSS to change the images?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript