Sololearn: Learn to Code
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 4
show your code
16th Jan 2024, 9:55 PM
Lisa
Lisa - avatar
+ 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 "
16th Jan 2024, 10:05 PM
Lisa
Lisa - avatar
+ 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>
17th Jan 2024, 2:42 AM
Solo
Solo - avatar
17th Jan 2024, 9:57 PM
JaScript
JaScript - avatar
+ 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
16th Jan 2024, 10:13 PM
Lisa
Lisa - avatar
17th Jan 2024, 5:14 PM
🌍🌎🌏ᴀɪᴍ🌎🌏🌍ᴵⁿᵃᶜᵗⁱᵛᵉ
🌍🌎🌏ᴀɪᴍ🌎🌏🌍ᴵⁿᵃᶜᵗⁱᵛᵉ - avatar
0
there is a little +, click Insert Code, sort for My Code Bits, select your code.
16th Jan 2024, 10:00 PM
Lisa
Lisa - avatar