How To Get Data Out Of Table Cells Into A Javascript Variable?
Javascript March 3rd, 2009Is it possible to get data out of table cells and put it into a Javascript variable? If so, how?
Sure, it is possible to get data out of table cells and put it into a Javascript variable. The best way is to put an id on the table, and get it by id.
<table id="getMe">
<tr><td>[some data]</td></tr>
</table>
var v, theTable;
theTable = document.getElementById("getMe");
v = theTable.rows[0].cells[0].value;
I hope that’s clear.