nevets2001uk
IS-IT--Management
I'm using JavaScript for the first time to create a DHTML website. I'm trying to create a small bit of code to swap between two images on the click of a button. The code I'm using is below...
onclick="document.all.imagename.src =document.all.imagename.src=='closebutton.gif' ? '' : 'maxbutton.gif'"
It's adapted from some code I've got working to hide and show a section of the page. It works the first time to change the image on the first mouseclick but doesn't revert back to the original image on the next click.
Just wondering if anyone could tell me what I'm doing wrong?
Thanks
Steve Gordon
onclick="document.all.imagename.src =document.all.imagename.src=='closebutton.gif' ? '' : 'maxbutton.gif'"
It's adapted from some code I've got working to hide and show a section of the page. It works the first time to change the image on the first mouseclick but doesn't revert back to the original image on the next click.
Just wondering if anyone could tell me what I'm doing wrong?
Thanks
Steve Gordon