jQuery - Each 3 a href from each div!
<p>I have some div's like</p>

<pre><code>&lt;div class="block-wrap"&gt;
&lt;a href="#"&gt;A&lt;/a&gt;
&lt;a href="#"&gt;A&lt;/a&gt;
&lt;a href="#"&gt;A&lt;/a&gt;
&lt;a href="#"&gt;A&lt;/a&gt;
&lt;a href="#"&gt;A&lt;/a&gt;
&lt;a href="#"&gt;A&lt;/a&gt;
&lt;/div&gt;

&lt;div class="block-wrap"&gt;
&lt;a href="#"&gt;A&lt;/a&gt;
&lt;a href="#"&gt;A&lt;/a&gt;
&lt;a href="#"&gt;A&lt;/a&gt;
&lt;a href="#"&gt;A&lt;/a&gt;
&lt;a href="#"&gt;A&lt;/a&gt;
&lt;a href="#"&gt;A&lt;/a&gt;
&lt;/div&gt;
</code></pre>

<p>etc</p>

<p>and a jQuery.</p>

<pre><code>$('div.block-wrap a').each(function(index) {
  if ((index+ 1) % 3 == 0)
     $(this).after("&lt;span&gt;&lt;/span&gt;");
});
</code></pre>

<p>This ads after 3 <em>a href</em> a span, but if I have in a div just 2 <em>a href</em>, it will add the span in the next div after one <em>a href</em>.
I need this count to be made for each div separately.
Can anybody help?
Thank you!</p>
