Answers for "src.replace() javscript"

21

javascript change image src

//change image src
document.getElementById('myImageID').src="images/my_other_image.png";
Posted by: Guest on July-31-2019
0

insert image using set atribute

var img = document.getElementById("example");
console.log(img.getAttribute("src")); // "images/foo.png"
console.log(img.src);                 // "http://example.com/path/images/foo.png"
Posted by: Guest on November-09-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language