Html – How to give html button tag an image


I am wondering if there is a way to give the HTML button tag, <button> an image so the image is click-able on my webpage. That way when users click on the image I can have other things happen

This doesn't seem to be working, and was wondering if it is even possible

HTML code –

<img src="images/dagger.png" width="10%" height="10%" id="dagger" />

Best Solution

Not quite sure what you are trying to achieve but maybe this example helps.


<img src="" id="dagger" />