Вариант 1:
<img src='abc.jpg' onclick='this.src="def.jpg"' />
Вариант 2:
http://godnote.tumblr.com/post/61761601864
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
function imgClick(evt){
lastSelected.style.zIndex = "0";
var imgObj = window.event ? event.srcElement : evt.target
imgObj.style.zIndex = "1";
lastSelected = imgObj;
}
window.onload = function(){
var imgs = document.getElementsByTagName("img");
for(var i = 0; i < imgs.length; i++){
if(imgs[i].className.indexOf("imgs") != -1){
imgs[i].onclick = imgClick;
}
}
window.lastSelected = imgs[0];
}
</script>
</head>
<body>
<img class="imgs" style="position: absolute;left: 0px;" src="http://24.media.tumblr.com/1d992ef0d0c8a10cec95571a535f4532/tumblr_msc9xy22sk1qfm87to1_500.jpg" alt="Изображение1">
<img class="imgs" style="position: absolute;left: 40px;" src="http://31.media.tumblr.com/c8f58d70f2ba8922036b38f99b34ac66/tumblr_msx8nh1tHj1saeqddo1_500.jpg" alt="Изображение2">
<img class="imgs" style="position: absolute;left: 80px;" src="http://25.media.tumblr.com/539a831fb1730c37d2c9c12178677b65/tumblr_mt9j0gZk2B1rt5ktoo1_500.jpg" alt="Изображение3">
</body>
</html>