Jump to content

[SOLVED] Cant figure this out!


addtrain

Recommended Posts

ok...

someone  gave me this code:

<html>
<head>
<script type="text/javascript">
function changeSrc() {
  document.getElementById("myImage").src="image2.jpg";
}
</script>
</head>
<body>
<img id="myImage" src="image1.jpg" onclick="changeSrc()" />
</body>
</html>

 

i want to do this with MULTIPLE IMAGES! how can i do this? i tried messing around with it, but then when you click on ONE of the images, BOTH images change! HELP ME PLEASE!

Link to comment
https://forums.phpfreaks.com/topic/64412-solved-cant-figure-this-out/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.