I have an image in my div:
<div class="pressphone">
<img class="phone" src="../img/template/iphone3.png">
</div>
how can I switch the photo to ../img/template/iphone4.png
from javascript/jquery?
I have an image in my div:
<div class="pressphone">
<img class="phone" src="../img/template/iphone3.png">
</div>
how can I switch the photo to ../img/template/iphone4.png
from javascript/jquery?
$("img.phone").attr("src", "../img/template/iphone4.png");
Note that this will replace the source of all images with class phone
!
If that is an issue, you should consider to give your image a unique id and change the jquery selector accordingly.