I have a huge html table that I am building dynamically, and I want to be able to get cell data out of it easily.
Here is how my table is set up.
<tr><td id="presCode0">V</td></tr>
<tr><td id="presCode1">F</td></tr>
Each row element is numbered when I build my table.
Each row has 5 cells and there are hundreds of rows in the table. Each row when clicked calls a function like this:
onclick="switchToRequest(rownumber)"
I have tried using:
function switchToRequest(i)
{
var presCode=''+'presCode' + i + '';
attend.elements["codePick"].value=presCode.innerHTML;
attend.elements["codePick"].value=$("#"+"presCode"+i);
}
is there any way that I can get table cell values out of a complex table using Javascript?
Try this:
or