title: Select every nth item in jQuery?
body: <p>jQuery has the handy :even and :odd selectors for selecting the even- or odd-indexed items in a set, which I'm using to clear every other item in a series of floated boxes, as follows:</p>
  
  <pre><code>&lt;div class='2up'&gt;
     &lt;div&gt; ... &lt;/div&gt;
     &lt;div&gt; ... &lt;/div&gt;
     ...
     &lt;div&gt; ... &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>// Clear every 2nd block for 2-up blocks
  $('.2up&gt;div:even').css("clear", "both");
  </code></pre>
  
  <p>This works like a charm.</p>
  
  <p>My question: Is there a straightforward way in jQuery to select every third or fourth item, so I could do the same thing with 3-up or 4-up items?</p>