title: Get count of child elements from one instance of a class
body: <p>I'm customising a tumblr blog, and I want to apply certain styles and rules depending on the number of photos present in a photoset.  What I'm not sure how to get a count of the child elements present in each post when each post has the same class.  If this is the sort of code that is generated by tumblr:</p>
  
  <pre><code>&lt;div class="photoset"&gt;
       &lt;img /&gt;
       &lt;img /&gt;
  &lt;/div&gt;
  
  &lt;div class="photoset"&gt;
       &lt;img /&gt;
       &lt;img /&gt;
       &lt;img /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How do I get jQuery to return the number of  elements in the first and second instances (i.e. 2 and 3)?</p>
  
  <p>I've tried using <code>$('.photoset img').length();</code> and that gives me a total count of all  elements present (i.e. 5 in this case).</p>
  
  <p>Any help would be greatly appreciated!</p>
  
  <p>Cheers,
  Scott</p>