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?