addtrain Posted August 11, 2007 Share Posted August 11, 2007 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! Quote Link to comment https://forums.phpfreaks.com/topic/64412-solved-cant-figure-this-out/ Share on other sites More sharing options...
ILYAS415 Posted August 11, 2007 Share Posted August 11, 2007 hmm check if this'll work... <img src="image1.jpg" onclick="this.src='image2.jpg';"> Quote Link to comment https://forums.phpfreaks.com/topic/64412-solved-cant-figure-this-out/#findComment-321175 Share on other sites More sharing options...
addtrain Posted August 11, 2007 Author Share Posted August 11, 2007 hey thanks for the reply! its working now Quote Link to comment https://forums.phpfreaks.com/topic/64412-solved-cant-figure-this-out/#findComment-321176 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.