title: jquery count first level elements from within .each() loop
body: <p>Does anyone know how to count just the first level children of an element from inside a .each() loop?</p>
  
  <p>For example, I have several  lists on my page, like so ...</p>
  
  <pre><code>&lt;ul&gt;
      &lt;li&gt;&lt;a href="#"&gt;item1&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;item2&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;item3&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;item4&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  &lt;ul&gt;
      &lt;li&gt;&lt;a href="#"&gt;item1&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;item2&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;item3&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;item4&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;item5&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;item6&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  &lt;ul&gt;
      &lt;li&gt;&lt;a href="#"&gt;item1&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;item2&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#"&gt;item3&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>I'm trying to loop through each  list and determine how many list items it has, except using jQuery .size() is counting the  tags as elements too.  I just need to know how many list items exist.</p>
  
  <p>Additionally, I'm not sure how to do this because using something like jQuery('ul > li').size() isn't accessible from within the .each() loop, because I'm referencing each different  with jQuery(this).  Is there a way to do something like jQuery(this ' > li')?  Cause that's not working for me either :)</p>
  
  <p>here's what i've been trying, but I'm not having any luck:</p>
  
  <pre><code>jQuery('ul').each(function() {
      var count = jQuery(this).find('li').size();
      alert(count);
  });
  </code></pre>