3
I would like to click on one image and display another in place, then click again and display one more and so on until I return to the original image.
I can only display one image. I started studying javascript a little while ago and not about what to look for to solve this.
function trocar(i) {
if (i == 1) {
document.getElementById("agni").src="img/gods-skin/agni-swagni.jpg"
}
<img id="agni" onclick="trocar(1)" alt="hindu" class="img-gods expand" src="img/gods/agni.jpg">
I’d appreciate it if someone could help
You have to create something from where the images are pulled, for example, an array.
– Sam