seanburby Posted April 25, 2011 Share Posted April 25, 2011 Hey guys,I'm having a bit of trouble working out how to successfully code the following:When image 'A' is clicked, image 'B' appears. Then when image 'B' is clicked, image 'A' appears again.In the code below, when 'Button.png' is clicked, 'Button2.png' appears. Then I need it so that when 'Button2.png' is clicked 'Button.png' appears. As you can appreciate, I'm pretty new to this stuff! <head><script type="text/javascript">function change(id){ ID = document.getElementById(id); if(ID.style.display == "") ID.style.display = "none"; else ID.style.display = ""; }</script></head><body><table width="217" align="center"> <tr> <td title="Show/Hide" style="cursor: hand" class="tbl" width="172" height="25">» <strong>Test </strong></td> <td title="Show/Hide" onclick="change(1), change(2), change(3), change(4)" style="cursor: hand" class="tbl" width="33"> <div align="center"><img src="Button.png" name="arrow" width="26" height="27" onClick="document.images['arrow'].src='Button2.png'"/></div></td> Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.