In a div I have an anchor tag. That anchor tag has a background image assigned to it using CSS.
When the user clicks on it, some JavaScript is executed, but I want to change the background image to another, then when they click on it again, the background image changes back to what it was originally.
Any help on how to do this (JQuery, CSS; I’m unsure) would be much appreciated.
Thanks in advance.
You can use toggleClass to change the background image.
Live Demo