lilman Posted April 29, 2007 Share Posted April 29, 2007 I am trying to determine an object image source, so I know which image to display when ‘onclick’. Here is my JavaScript code: function togglePhoto(objectPhoto) { var object = document.getElementById(objectPhoto); state = object.document.images.src; if (state == 'Contro1.gif') object.document.images.src = 'Contro2.gif'; else if (state != 'Contro1') object.document.images.src = 'Contro1.gif'; } Here is where I call the function: <tr> <td width="8%"><img border="0" src="Contro1.gif" width="47" height="35" id="mystatspic"></td> <td width="92%"> <p align="left"><b><a onclick="toggleDisplay('mystats'); togglePhoto('mystatspic')" href="javascript:void('')"> <font face="Arial" color="#FFFFFF" size="2">My Stats</font></a></b> </td> </tr> Quote Link to comment Share on other sites More sharing options...
fenway Posted April 30, 2007 Share Posted April 30, 2007 "Object" is reserved... but what else doesn't work? Quote Link to comment 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.