1
How to change an image using Javascript?
I made this code here but it didn’t work.
html file
<a href="passo1.html" target="janela">
<img id="passo1" class="passo" src="img/passo_color1.png" style="float:left">
</a>
js file
teste = document.querySelector("#passo1").addEventListener('click', function(){
teste.src = "img/passo_color.jpg";});
In this case this target is for an iframe that comes just below the image, as I click on the image, the iframe comparison changes.. the idea is this... but I will try to do here with what you sent... I saw that in Jsfiddle it worked !!! ;)
– Diego Henrique Engel
Hmmm, now it makes so much more sense.
– carla