How to get all the image sources on a particular Page using Javascript
You indeed told the code to do so. Don't do that. Just tell it to loop over all images and push the src of each in an array and return the array with all srcs instead.
function img_find() {
var imgs = document.getElementsByTagName("img");
var imgSrcs = [];
for (var i = 0; i < imgs.length; i++) {
imgSrcs.push(imgs[i].src);
}
return imgSrcs;
}
It may help you...
img=document.getElementsByTagName("img");
for(i=0; i<img.length; i++) {
imgp = imgp + img[i].src + '<br/>';
}
document.write(imgp);