title: jquery - Get the occurrence of an element
body: <p>I have a div which contains 5 images.</p>
  
  <p>I want to write to a p tag every occurrence of the img</p>
  
  <pre><code>$("#myDiv img").each( function() {
      $("p").append($(this).length);
  });
  </code></pre>
  
  <p>The above returns:</p>
  
  <p><code>11111</code></p>
  
  <p>What I want to return is:</p>
  
  <p><code>12345</code></p>