Answers for "how to make a variable an image in javascript"

0

javascript image to variable

var img1 = document.createElement("img");
img1.src = "http://path/to/image";
Posted by: Guest on July-11-2021
0

javascript image to variable

document.body.appendChild(img1);
document.querySelector(".some-class").appendChild(img1);
document.getElementById("someId").appendChild(img1);
Posted by: Guest on July-11-2021

Code answers related to "how to make a variable an image in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language