I was wondering how to display an image inside of a button.
I have this code:
<input type="button" value="TEXT GOES HERE" onclick="showImage();"/>
And I wish to place an image within the button instead of text. I tried setting the value field to the path of the image:
<input type="button" value="this.src='Images/pickups.png'" onclick="showImage();"/>
but instead of displaying the image it simply displays the this.src...
as text.
If you want a button
, use button
html tag, and inside put img
tag with src
attribute pointing to your image url
<button type="button" onclick="showImage();"><img src="favicon.ico"/></button>