Hi.
I am using JavaScript to dynamically create a table with a number of <TD> depending on the user who logged on (some want to see three values and others want to see five values...):
[blue]
[/blue]
To fill the variable number of <TD>s I am using some JavaScript functions. Of course, this should happen in a for-loop. In this loop I want to use a code like this to get the element and then put a value into the <TD>:
[blue]
[/blue]
What can I do to access thes elements using JavaScript?
Thank you,
Dirk
I am using JavaScript to dynamically create a table with a number of <TD> depending on the user who logged on (some want to see three values and others want to see five values...):
[blue]
Code:
<SCRIPT language="JavaScript1.2">
document.write('<table class="clocks" border="1" bordercolor="#11fff1" width="100%" cellspacing="0" cellpadding="0" height="35">');
document.write('<tr>');
for(x=0; x<numOfTimezones; x++)
{
document.write('<td ID="Clock"' + x + ' valign="top" align="center" style="font-family: Verdana, Tahoma, Arial; font-size: 10px; padding-top: 2px;" >Clock' + x + '</td>');
}//end for x
document.write('<(tr>');
document.write('</table>');
</SCRIPT>
To fill the variable number of <TD>s I am using some JavaScript functions. Of course, this should happen in a for-loop. In this loop I want to use a code like this to get the element and then put a value into the <TD>:
[blue]
Code:
for(x=0; x<numOfTimezones; x++)
{
document.getElementById('Clock'+x).innerHTML =
'<font color="' + ct[x].cl + '">' + ct[x].tz + ClockString(ct[x].ct) + '</font>' ;
}//end for x
What can I do to access thes elements using JavaScript?
Thank you,
Dirk