Sorry!
I copied and pasted the code from a different example
Here it is:
Code:
<html>
<head>
<script type="text/javascript">
cc=0
function changeimage()
{
if (cc==0)
{
cc=1
myimage.src="bulbon.gif"
}
else
{
cc=0
myimage.src="bulboff.gif"
}
}
</script>
</head>
<body>
<img id="myimage" onclick="changeimage()"
border="0" src="bulboff.gif"
width="100" height="180" />
<p>Click to turn on/off the light</p>
</body>
</html>
Markdidj: thanks for the reply.
Yes, I've understood it was an 'onclick "toggle"' but I still can't explain (in plain English...) why the function is formulated that way. I know it works, but I don't know how.
Anybody?
Thanks.
Bookmarks