title: Finding the count of <td> Jquery
body: <p>I have the following HTML structure and I wanted to find out the length of immediate <code>&lt;td&gt;s</code>. here is the code that I am using:-</p>
  
  <pre><code>&lt;table class="PrintTable"&gt;
      &lt;tr&gt;
        **&lt;td&gt;**
          &lt;table&gt;
              &lt;thead&gt;
                  &lt;tr&gt;&lt;th&gt;Type Of Transaction&lt;/th&gt;&lt;/tr&gt;
              &lt;/thead&gt;
              &lt;tbody&gt;
                  &lt;tr&gt;
                      &lt;td&gt;Name&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;Age&lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/tbody&gt;
          &lt;/table&gt;
        &lt;/td&gt;
        **&lt;td&gt;**
          &lt;table&gt;
              &lt;thead&gt;
                  &lt;tr&gt;&lt;th&gt;2006&lt;/th&gt;&lt;/tr&gt;
              &lt;/thead&gt;
              &lt;tbody&gt;
                  &lt;tr&gt;
                      &lt;td&gt;Andi&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;25&lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/tbody&gt;
          &lt;/table&gt;
        &lt;/td&gt;
  
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>The function that I am using to find out the length of td is</p>
  
  <pre><code>function getBody(element)
  {
      var divider=2;
      var originalTable=element.clone();
      var tds = $(originalTable).children('tr').children('td').length;
      alert(tds);
  
  
  }
  </code></pre>
  
  <p>The result I am seeing is 0. No clue at all. I am expecting 2. Any help will be appreciated.</p>