1
I’m having a hard time making an event onclick
work. I wanted to swap an image of an image type input.
I did a test with a simple Alert and also not called the function.
Here’s part of my code.
<div class="bg-secund">
<input type="image" src="img\0.gif" id="1" onclick="click()" />
</div>
<script>
function click() {
document.getElementById("1").src = "img/0.gif ";
}
</script>
In addition to what João said, notice that right now your function changes the image to the same image. Change the name of the image you want to have...
– Sergio