How to wrap every 6 divs of the same class in another div using slice?
<p>An example of the divs I use:</p>

<pre><code>&lt;div id="slider"&gt;
    &lt;div class="thumb" id="ipsc-thumb" &gt;
        &lt;a href="#featured"&gt;&lt;img src="images/thumbs/ipsc-bwthumb.jpg" alt="" /&gt;&lt;/a&gt;
    &lt;/div&gt;
    &lt;div class="thumb" id="ipsc-thumb" &gt;
        &lt;a href="#featured"&gt;&lt;img src="images/thumbs/ipsc-bwthumb.jpg" alt="" /&gt;&lt;/a&gt;
    &lt;/div&gt;
    &lt;div class="thumb" id="ipsc-thumb" &gt;
        &lt;a href="#featured"&gt;&lt;img src="images/thumbs/ipsc-bwthumb.jpg" alt="" /&gt;&lt;/a&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>I want to wrap every 6 of these items with <code>.thumb</code> class in a div</p>

<pre><code>&lt;div class="scrollable"&gt;&lt;/div&gt;
</code></pre>

<p>I wrote this until now:</p>

<pre><code>var divs = $("div.thumb");
for(var i = 0; i &lt; divs.length; i+=6) {
    divs.slice(i, i+6).wrapAll("&lt;div class='scrollable'&gt;&lt;/div&gt;");
}
</code></pre>

<p>It doesn't wrap them in any div, where is my mistake?
Thanks a lot in advance!</p>
