I have a HTML table. In this table I have links in last column (with id="delete_row"). I am trying to extract each link and it is not working. I have seen some posts about it and learned it might be a spelling issue but I checked everything twice and still cannot get it going. Here is my code:
var tbl = document.getElementById('my_table');
for (var i = 0 ;i<tbl.rows.length-1; i++) { // for each row
row = tbl.rows[i];
row.getElementById('delete_row').className="other_classname";
}
This code however returns error:
Uncaught TypeError: Object #<HTMLTableRowElement> has no method 'getElementById'
Any Idea what might be wrong?