title: jquery: children() vs child selector ">"
body: <p>I have a table that has a section similar to the following:</p>
  
  <pre><code>&lt;tr&gt;
      &lt;td&gt; &lt;span class="myclass"&gt;&lt;/span&gt;
      &lt;/td&gt;
  &lt;tr&gt;
  </code></pre>
  
  <p>my $(this) is set to the tr element and I'm trying to access the Span elements that have the "myclass" class set.
  The following seems to work:</p>
  
  <pre><code>if ($(this).children('td').children('span').is('.myclass')){
      alert('in here');
  }
  </code></pre>
  
  <p>but when trying to use this:</p>
  
  <pre><code>if ($(this).children("td &gt; span").is('.myclass')){
  </code></pre>
  
  <p>or this:</p>
  
  <pre><code>if ($(this).children("td span").is('.myclass')){
  </code></pre>
  
  <p>It does not.  I thought that either of the above 2 would come up with similar results (albeit through different methods) but apparently not.</p>
  
  <p>What am I missing here?</p>
  
  <p>Thanks!</p>