I found a way to change an image when clicking on it... but im searching to make a loop, means to click again and get back the old image and then click again to get the new image (only 2 images needed).
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#ChangeImage").click(function(){
$('#ChangeImage').attr('src','image2.jpg');
});
});
</script>
<img src="image1.jpg" name="my_pic" id="ChangeImage">
I cant find a way to make it vice versa...thanks for your help!!
Click the image to toggle it:
lol i cant find anything wrong :/..its 1 AM here...when I use those cat photos it works but with my images its not
– Paul G. Nahed Jan 27 '13 at 22:17