gtilflm gtilflm - 5 months ago 12
jQuery Question

Select innerHTML from First <td> of Last <tr> -- jQuery

I have some rows in a table like this:

<tr class="problem_display_work>
which have two
<td>
s each.

I'm trying to select/alert the innerHTML like this:
alert($('tr.problem_display_work td:first-child').innerHTML);
but it's not working.

What am I missing here?

Answer

try

alert($('tr.problem_display_work td:first').html());

edit for last tr

alert($('tr.problem_display_work:last td:first').html());