title: jQuery $.parents() not Functioning Properly
body: <p>I have a following code in my html file and i want to access the grand parent of an element like the table which is the grand parent of td in the following code. For this I used the following jquery syntax but it displays "undefined". can any one guide me where the problem is ?</p>
  
  <pre><code>  &lt;script type="text/javascript"&gt;
  
     $(document).ready(function () {
       alert($('td[id="4"]').parents().eq(1).attr("id"));
    });
  
  &lt;/script&gt; 
  
  &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form id="form1" runat="server"&gt;
    &lt;div  class="ui-layout-center" id="center" runat="server"&gt;
       &lt;table id="Table1" &gt;             
          &lt;tr id="tr1"&gt;
              &lt;td id="3" class="cell" &gt;
                 first cell 
              &lt;/td&gt;
              &lt;td id="4" class="cell"&gt;
              second cell
              &lt;/td&gt;
          &lt;/tr&gt; 
       &lt;/table&gt;
      &lt;br /&gt;
      &lt;br /&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>