To programmatically change the src of an img tag with JavaScript, we set the src
property of the img element.
For instance, we write
document.getElementById("imageid").src = "../template/save.png";
to select the img element with getElementById
.
Then we set its src
property to the path string or URL of the image.