Unfortunately, I don't have an example up.
But, to my mind, it makes sense to do $('#myElement').parent().parent() because the parent of the <input> is a <td> and the parent of the <td> is the <tr>. Or is that wrong?
Derrek
On 10/18/06, John Resig <[EMAIL PROTECTED]> wrote:
> However, this produces no visual effect:
> $('#myElement').parent('tr')
> .before('<tr><td class="errorCell" colspan="100"><span class="error">Please
> correct the error</span><br /></td></tr>');
>
> If I change the code, I see my new row:
> $('#myElement').parent().parent()
> .before('<tr><td class="errorCell" colspan="100"><span class="error">Please
> correct the error</span><br /></td></tr>');
>
> I don't like this since it's bound to a specific table arrangement.
>
> Does anyone have any hints or different solutions?
What happens if you just do:
$('#myElement').parent().before('<tr>...</tr>');
It seems like something like that should work just fine. (The fact
that .parent().parent() works kind of makes me suspicious) Do you have
an example up anywhere of the problem in action?
--John
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
_______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/