I took the above suggestions and was able to move it to a function as shown below. I also made a few improvements for reusability sake. I still have 2 problems.
1) the image still doesn't swap.
2) the page refreshes. I was under the impression that if I returned false from the function, that it would not refresh the page. Am I mistaken??
I am trying to swap the source of the image in the image tag when the onclick event of the A HREF fires off. I know I should have this as a separate function as opposed to trying to do it inline, but that isn't a possibility for what I am doing. If I take out the image swap if, it fires correctly, but with it in, it isn't firing.
Leave a comment: