ken_shoti
05-06-2007, 11:20 AM
I want to access a particular cell in a table...telling javascript to click that cell which has a corresponding action...
<script>
document.write('<table id=t1>')
for (i=0;i<5;i++){
document.write('<tr><td onclick=action()></td><td>...</td></tr>')
}
document.write('</table>')
t1.rows[0].cells[0].click() //click cell 1 of row 1
</script>
and i would use this code for that....
these are only samples..each rows are actually created in a loop...but what if....
<script>
document.write('<table id=t1>')
for (i=0;i<5;i++){
document.write('<tr><td onclick=action()><table><tr><td onclick=action()></td></td></tr></table></td><td>...</td></tr>')
}
document.write('</table>')
</script>
that table i need is nested under the table t1....i cant use ids here since i'm doing a loop there..so is there a solution to achieve the clicking on a cell done on the former code?
i want this time to click cell 1 of row 1 IN table t1 row 1 cell 1
Thanks!
<script>
document.write('<table id=t1>')
for (i=0;i<5;i++){
document.write('<tr><td onclick=action()></td><td>...</td></tr>')
}
document.write('</table>')
t1.rows[0].cells[0].click() //click cell 1 of row 1
</script>
and i would use this code for that....
these are only samples..each rows are actually created in a loop...but what if....
<script>
document.write('<table id=t1>')
for (i=0;i<5;i++){
document.write('<tr><td onclick=action()><table><tr><td onclick=action()></td></td></tr></table></td><td>...</td></tr>')
}
document.write('</table>')
</script>
that table i need is nested under the table t1....i cant use ids here since i'm doing a loop there..so is there a solution to achieve the clicking on a cell done on the former code?
i want this time to click cell 1 of row 1 IN table t1 row 1 cell 1
Thanks!