0
Changing image attribute
Please explain how to change image src attribute using document object My code: https://code.sololearn.com/W2oW3lnA0Waw/?ref=app Thanks in advance
5 Respostas
+ 3
O.Naga Lakshmi Lalasa your code is working perfectly. You just need a valid online url.
Ore Adeleye's code is also fine.
+ 3
https://code.sololearn.com/Ww4GVzzFr5AR/?ref=app
https://www.sololearn.com/discuss/389765/?ref=app
https://www.sololearn.com/discuss/2138994/?ref=app
https://www.sololearn.com/discuss/1572389/?ref=app
https://www.sololearn.com/discuss/2215338/?ref=app
https://www.sololearn.com/discuss/803683/?ref=app
+ 1
Thankyou so much.You've given everything i needed.
0
el.setAttribute("src", "apple.png")
0
Kevin image tag doesn't work for me all the time.Even if i give exact path of an image still image will not be displayed.can you please explain me syntax of image tag and an example in HTML?Thanks in advance.