Although I've researched several articles and answers on Stack Overflow, none of them have addressed my question thoroughly. Admittedly, I am quite new to jQuery and unsure about how to proceed.
I am working on an HTML landing page where I aim to display multiple images that change when clicked, toggling between two different images. Essentially, clicking on an image should replace it with another one, and vice versa.
Here is what I have accomplished so far:
<div class="santa">
<img class="show" src="images/santa.png" alt="">
<img class="hide" src="images/bubble.png" alt="">
</div>
.hide { display: none; }
.show { display: block; }
The desired behavior is for the default image santa.png
to be displayed initially, and upon clicking, it should switch to bubble.png
. This means that the default class should be show
, switching to hide
once clicked, and vice versa for santa.
Thank you in advance for your help!