<html>
<head>
<script>
function changeImageOnClick(){
image=document.getElementById("image1");
if(image.src.indexOf("pict1.png")<0)
image.src="pict1.jpg";
else
image.src="pict2.jpg";
}
</script>
</head>
<body>
<img src="pict1.png" id="image1" onclick="changeImageOnClick()"/>
</body>
Here is the working example:
Žádné komentáře:
Okomentovat