Hi, I can seem to get something working:
Code:
intImage = 2;
function swapImage() {
switch (intImage) {
case 1:
IMG1.src = "plus.gif"
intImage = 2
return(false);
case 2:
IMG1.src = "min.gif"
intImage = 1
return(false);
}
}
Code:
<IMG id="IMG1" name="IMG1" src="plus.gif" onclick="swapImage();">
The above code swap an image on a "onclick" event, and swaps back when clicked again. The only problem is that it only works for 1 img; IMG1. How can I make a "general" function of this that works for any id given?