Question: 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?

Answer: 
Try this:

```
attend.elements["codePick"].value = $("#"+"presCode"+i).html();

```

or 

```
attend.elements["codePick"].value = $("#"+"presCode"+i).text(); // to get text minus html tags

```
```
function switchToRequest(i)
{
var presCode=''+'presCode' + i + '';
attend.elements["codePick"].value=document.getElementById(presCode).innerHTML;
attend.elements["codePick"].value=$("#"+"presCode"+i);
}

```