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?

1/19/2020 3:57:54 PM


5 Answers

New Answer




Thank you Kevin Star and visph for answering my question and helping me


image.src = "https://hello"


You are welcome 😃


thanks a lot I wish u could come in my country