I have 3 images that I want to switch between. I put each one of them in a class & change it\'s image in the css. I can now switch between 2 classes but when I add the
The safest way would be to remove unwanted classes and add the required class:
// Switch to class 'three' $(this).removeClass('one').removeClass('two').addClass('three');