New course! Every coder should learn Generative AI!
Try a free lesson+ 4
show your code
+ 2
<button>
<img src="http://www.sololearn.com/images/tree.jpg">
Click me
</button>
<button> has an opening and closing tag, the image needs to be in between them.
<img> ends with a >
the src of the image needs to be between " and "
+ 2
justyn if you want an image to appear when you click on the button, then you need to use the onclick attribute to make it interactive, for example:
<img id="tree" src='http://www.sololearn.com/images/tree.jpg' style="display:none">
<br>
<button onclick="tree.style.display='block'">Click me</button>
+ 2
This will help you:
https://sololearn.com/compiler-playground/W0zH3IDDAEPP/?ref=app
+ 1
src="http://www.sololearn.com/images/tree.jpg"
the src value of the image โ the http:...jpg part โ has a " in the beginning and one at the end
0
there is a little +, click Insert Code, sort for My Code Bits, select your code.