var myText = $('#knowndiv').parents('table').find('td:first').text();
alert(myText);

Maurício
  -----Mensagem Original----- 
  De: con-man-jake 
  Para: jQuery (English) 
  Enviada em: terça-feira, 2 de junho de 2009 16:38
  Assunto: [jQuery] text of first sibling of a parent...How do I get it



  Still a newbie.
  I have this:

  <table>
     <tr>

        <td>
           text I want to get
        </td>

        <td>
        </td>

        <td>
           <div id="knowndiv"></div>
        </td>

     <tr>
  </table>

  If I have the div with id of "knowndiv" as an object (call it "obj"),
  How do I get the text inside the first <td>?

Reply via email to