Javascript loop - to get element value from iframe

Hi,

Can anyone help me?

iframe name/id = “monitor_V2”
elements name/id= time1 time2 time3 time4… time100

the thing is, this code is working if I’m going to get only the value of “time1”:



var ccount = window.frames['monitor_V2'].document.
                   getElementById('time1').innerHTML ;

document.writeln(ccount);


but if I loop this to get the value of “time1 to time100”:



for (i=1; i<=100 ; i++)
{


var ccount = window.frames['monitor_V2'].document.
                  getElementById('time' + i).innerHTML ;



document.writeln(ccount);
}


If I use this code… it doesn’t loop. It only displays the value of time100

can anyone help me??

document.writeln is overwriting the entire web page with the value of ccount the first time it is called - the script then no longer exists and neither do any of the other frames you are wanting to process.