Get the js code of the src address of img under the div_Basic knowledge
![WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB](/static/front/mobimages/moren/moren.png)
- WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
- 2016-05-16 19:18:171906browse
Purpose: Get the src of img under div
html:
< div id="image2">
![](loading.gif)
.
.
My error code:
initImage();
loadImage();
function initImage() {
for(var i=1;i<13;i ) {
imageId[i]=document.getElementById("image" i);
}
}
function loadImage() {
for(var j=1;j<13;j ){
imageList[j]=imageId[j].getElementsByTagName("img")[0];
if(imageId[j].src ==="images/loading.gif")
imageId[j].src="images/" j ".gif";
else.....
}
}
Code to solve the problem