95
rated 0 times
[
98]
[
3]
/ answers: 1 / hits: 65477
/ 13 Years ago, mon, april 11, 2011, 12:00:00
I want to manipulate table cells with javascript, and so far I managed to get into tr-s, by using:
var as = document.getElementById('answers['+id+']');
var trs = as.getElementsByTagName(tr);
for (var i in trs)
{ ... }
UPDATE: The as
variable contains a reference to the table.
Inside of the for cycle I wanted to go on the same login line and I have tried:
var tds = trs[i].getElementByTagName(td);
The problem is that on debugging I get the following error:
Uncaught TypeError: Object #<HTMLTableRowElement> has no method 'getElementByTagName' .
How could I get into the td-s of the tr-s?
More From » html