i'm using getElementById() function to get the <img> in the document.... these <img> are the array of the images.... while using the getElementById() in javascript, it always returns 'null'
html code
I think by keeping the same name <img> will be treated as array of images...Code:Ex... <img name=sameName> <img name=sameName> <img name=samename>
using Javascript code,
always, 'obj' object is 'null'... what is wrong in my code...??Code:var obj; var iTotalImg = ...; // this is calculated for (i = 0; i <iTotalImg; i++) { obj = document.getElementById("sameName[" + i + "]"); obj.src = imgList[i]; //obj will always be 'null' }
Cheers!
VB




Reply With Quote