Try this:
$("#knowndiv').parent('td').prev().prev().html();

Think thats gonna work out.

2009/6/3 jake dimano <jakedim...@gmail.com>

>
> Mauricio and Ricardo,
> I applied all the suggestions, parent(), parents() and all the other
> functions, but still to no avail.  The weird thing is that when I
> strip out all the styles, attributes and events from the elements and
> reduce the number of "tr"s to less than 10 but keep the structure
> intact, it works!
> At any rate, thanks to all.  Too much effort has gone fruitless at
> this point.  I will have to resort to a different solution altogether.
> jake
>
> On Wed, Jun 3, 2009 at 2:44 PM, Mauricio (Maujor) Samy Silva
> <css.mau...@gmail.com> wrote:
> >> On Wed, Jun 3, 2009 at 11:20 AM, BigAB <adamlbarr...@gmail.com> wrote:
> >>
> >> > have you tried
> >> > var myText = $('#knowndiv').parents('tr').find('td:first').text();
> >> > alert(myText);
> >>
> >> > The TR is really the parent of the TDs, not the table.
> >
> > For information only.
> > I've used parents() not parent().
> > parents() means ancestor and table is ancestor of TDs
> >
> > See: http://docs.jquery.com/Traversing
> > Maurício
> > ---------------------------------------------------------------------
> >
> > -----Mensagem Original-----
> > De: Ricardo
> > Para: jQuery (English)
> > Enviada em: quarta-feira, 3 de junho de 2009 15:15
> > Assunto: [jQuery] Re: text of first sibling of a parent...How do I get it
> >
> > There is no reason why you shouldn't get this working with one of the
> > examples provided. For the nesting issue, filter with :first:
> >
> > $('#knowndiv').parents('tr:first').children('td:first').text();
> >
> > parents(xx:first) is similar to closest(xx), only the latter will also
> > try to match the element itself.
> >
> > On Jun 3, 1:01 pm, jake dimano <jakedim...@gmail.com> wrote:
> >> Yes, that is the first thing I did, to no avail. I think all I am
> >> left with just trudging through this with pure javascript.
> >> jake
> >>
> >> On Wed, Jun 3, 2009 at 11:20 AM, BigAB <adamlbarr...@gmail.com> wrote:
> >>
> >> > have you tried
> >> > var myText = $('#knowndiv').parents('tr').find('td:first').text();
> >> > alert(myText);
> >>
> >> > The TR is really the parent of the TDs, not the table.
> >>
> >> > On Jun 3, 7:33 am, jake dimano <jakedim...@gmail.com> wrote:
> >> >> Mauricio, your code basically works fine on a simple test page. But
> >> >> there is something about my set-up that makes the bit about
> > ...
>



-- 
Gustavo Salome Silva

Reply via email to