0
can you use an img id in an Array?
OPTION 1: <html> <body> <img id="first" src="anImage.png"> <img id="second" src="anotherImage.png> </body> <script> var images = ["first", "second"] </script> OPTION 2: <html> <body> </body> <script> var images = ["anImage.png", "anotherImage.png"] </script>
1 Réponse
+ 3
Tyler M, this should be possible.
work with numeric arrays.😄
var pic = new Array();
pic[0] = ("img.png");
pic[1] = ("img1.png");
pic[2] = ("img2.png");
document.getElementById("myImgBox").innerHTML = pic[0];
<img id="myImgBox" />
<div id="myImgBox"></div>