changing image with js | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

changing image with js

https://code.sololearn.com/W0w3gl9vhx26/?ref=app Instead of logging "that girl ain me" when I click the button I wanna change the picture with another one

24th Oct 2020, 8:37 PM
Boyan Ivanov
Boyan Ivanov - avatar
2 Answers
+ 2
With js you can use id in img tag and change src value with document getElementById("imgid").src = "new source link url". Here i try your code.https://code.sololearn.com/WdsFc3R5Juo7/?ref=app
24th Oct 2020, 9:05 PM
HBhZ_C
HBhZ_C - avatar
+ 1
thx
24th Oct 2020, 9:09 PM
Boyan Ivanov
Boyan Ivanov - avatar