Using document.createElement
and appendChild
, you might do:
var myContainer = document.getElementById("someContainerId");
for (i=0;i var myimg = document.createElement("img");
myimg.src= tar[i];
myimg.width="100";
myimg.height="100";
myContainer.appendChild(myimg);
}
Make sure, of course, that there really is a container element with the id of someContainerId
, or whatever id you want to give it. It might be best if the container element were a .
No comments:
Post a Comment