Skip to content
Advertisement

Changing input button to images

I am new to JavaScript.
I am having trouble changing the show button and hide button to images instead.
The show button will be a different image to the hide button.
How would I go about doing this?

https://jsfiddle.net/ej0r4amd/2/

JavaScript
JavaScript

Advertisement

Answer

Since you’re using jQuery, you can use the <input type="image"> and change the src attribute using .attr("src".

JavaScript
JavaScript
Advertisement