<html> <img SRC="Max-it1.png" onclick=imgchange(this,"Max-it1.png","img1.jpg")> <script> var x=false function imgchange(obj,imgX,imgY) { if (x){ obj.src=imgX } else { obj.src=imgY } x=!x } </script> </html>