Jump to content

Reading a table cell


justinbriggs1

Recommended Posts

Thanks everybody for their help over the past couple of days, but I have another question.I would like to be able to read the contents of a particular cell into a variable. Here is a portion of the code,var tbl = document.getElementById('tblSample');//I need to retrieve the contents of cell 0 in row 2var retrieveRow = tbl.rows[2];var retrieveCell = retrieveRow.cells[0];var cellText = retrieveCell.firstChild.nodeValue;//This is the problem I think//Then I just want to print it for confirmationdocument.write(cellText);Any help would be greatly appreciated.JW

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...