[jQuery] parent help

[jQuery] parent help


I am returning a form in an ajax call that is built with a table

I want to find an input

$('input[{$k}]')

then i want the immediate parent tr of that input.

I have tried

$('input[{$k}]').parents("tr:last").addClass("error-field");

and

$('input[{$k}]').parents("/../tr:last").addClass("error-field");

but both solutions get a different tr that i don't want to change.

the html looks like

<tr>
<td>E-Mail Address</td>
<td><input name="email" type="text" value="email" /></td>
</tr>

and i want to add the class to the tr.

any help would be greatly appreciated. Thanks.
--
View this message in context: http://www.nabble.com/parent-help-tp18498309s27240p18498309.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.