I want to swap two images back and forth based on a mouse click. eg + and -.
i am doing this on a tree structure based on the values extracted from the database.
eg
+ English
- Maths
- Trignometry
+ Chemistry
and the code which i am using is
<script language='javascript' type='text/javascript'>
intImage = 2;
function swapimage() {
switch (intImage) {
case 1:
imgname.src = "plus.gif"
intImage = 2
return(false);
case 2:
imgname.src = "minus.gif"
intImage = 1
return(false);
}
}
</script>
Now the problem is that i am only able to do this image swapping on 'English'. But i want this for the entire TREE Structure based on the node which the user clicks.
Please help.....