title: jQuery: Is using children() more efficient than using child selector
body: <p>I often need to setup jQuery events on li tags that don't have a class or ID associated with them like in this example:</p>
  
  <pre><code>    &lt;div id="menu"&gt;
        &lt;ul id="nav"&gt;
          &lt;li&gt;Nav Item 1&lt;/li&gt;
          &lt;li&gt;Nav Item 2&lt;/li&gt;
          &lt;li&gt;Nav Item 3&lt;/li&gt;
          &lt;li&gt;Nav Item 4&lt;/li&gt;
          &lt;li&gt;Nav Item 5&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>My understanding is that jQuery selecting reads from right to left so if I were to use a <code>$('#nav &gt; li)</code> jquery selector it would have to search through all of the li tags and then evaluate whether the li tag had a parent with the id of nav. </p>
  
  <p>Assuming this page has 30 li tags but I only want to select the 5 in the example, would it be more efficient to use <code>$('#nav').children('li')</code> ? My logic is that it will quickly find the #nav ID and then will only have 5 elements inside of it to search through. </p>
  
  <p>An additional question I have is If there were more than 30 child elements to #nav would it then be more efficient to use the child selector <code>$('#nav &gt; li')</code>?</p>
  
  <p>Thanks in advance</p>