+ 6

Does anyone know how to change an image with JavaScript?

Example: HTML: <img src="https://image" id="image"> JS: var image=document.getElementById('image'); And i don't know how to change the image in JavaScript, like here the image's source is "https://image", how to change it to for example to "https://hello", using javascript?

19th Jan 2020, 3:57 PM
A P
A P - avatar
5 Answers
19th Jan 2020, 4:14 PM
Kevin ★
+ 4
You are welcome 😃
20th Jan 2020, 1:27 AM
Kevin ★
+ 3
Thank you Kevin Star and visph for answering my question and helping me
19th Jan 2020, 11:15 PM
A P
A P - avatar
+ 2
image.src = "https://hello"
19th Jan 2020, 4:07 PM
visph
visph - avatar
0
thanks a lot I wish u could come in my country
21st Jan 2020, 4:07 PM
peacy jovics