Matt, you're assuming this is simple! if this is <center><b><i>Ha
Ha</i></b></center> .... yours breaks

Josh, tables are ugly, accessing them is ugly too! If you have one or two
lines like that it's ok to be ugly.

$.fn.grandTD = function(){return this.parents("td:first").parents("td:first")}


might make get a bit shorter

On 6/7/07, Matt Stith <[EMAIL PROTECTED]> wrote:

You could just do

$(this).parent().parent().addClass("greenback");

That should work fine.

On 6/7/07, Josh Nathanson < [EMAIL PROTECTED]> wrote:
>
>
> I am trying to select the first td element two levels up from the
> clicked
> div element.
>
> I have this, which works, but it's ugly.
>
>
> $(this).parents("td:first").parents("td:first").attr("class","greenback");
>
> Is there a cleaner way?
>
> - Josh
>
>
>



--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ

Reply via email to