Jump to content

Multiple onclick images


Recommended Posts

So I have a many images that I want the user to be able to toggle.very much like thishttp://www.w3schools.com/dhtml/tryit.asp?filename=trydhtml_intro the only issue I have is that using that code I cannot seem to make another image toggle. I rewrote the scrpt as follows, the only issue I have is that I cannot toggle it back. Any ideas? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><title>Untitled Document</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta http-equiv="Content-Style-Type" content="text/css"><meta http-equiv="Content-Script-Type" content="text/javascript"><script type="text/javascript">function changeImg(img, newimg) {img.src = newimg;}</script><body><img onclick="changeImg(this, 'staten_uw.jpg')" src="staten_moored.jpg"><img onclick="changeImg(this, 'block_uw.jpg')" src="block_moored.jpg"></body></html>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...