...

Basic DOM traversing (Jquery)

spetsacdc
07-10-2008, 08:36 PM
Hi, I have a table like this:

<table>
<tr>
<td><a>moose.jpg</a></td>
<td>16kb</td>
<td><a>delete</a></td>
</tr>
</table>

The row is passed to a function via an onclick event using this script: http://www.frequency-decoder.com/2007/11/15/unobtrusive-table-actions-script.

It is for a file browser. I need to get the text from the first td in the row (the file name).

I can get the text for the entire row, but not only the first td.

function rowSelectCallback(details){
var all_tds = $j(details.row).children('td').text();
alert(all_tds);
return true;
}

This alerts moose.jpg16kbdelete

Any ideas how to only get moose.jpg?

Thanks

shyam
07-11-2008, 05:08 PM
$j(details.row).children('td:first').text();

spetsacdc
07-11-2008, 05:11 PM
Ah thanks!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum