I am sure that this is not a specific jQuery question, but I use it to accomplish my task, so I will describe what I need in the context of jQuery and HTML. I have an HTML page with divs that are generated by the server. They look like
<div class="image"><img src="image1.png" /></div>
<div class="image"><img src="image2.png" /></div>
...
<div class="image"><img src="imagen.png" /></div>
The divs counter is variable and can be, for example, 40-50. I take their collection with something like this: images = jQuery('.image');
Now I need to take every 9 divs from the collection and put them in a newly created container, for example, as follows:
<div class="container1">
<div class="image"><img src="image1.png" /></div>
<div class="image"><img src="image2.png" /></div>
<div class="image"><img src="image3.png" /></div>
...
<div class="image"><img src="image9.png" /></div>
</div>
Then I need to take the following 9 elements and put them in a similar newly created div, for example:
<div class="container2">
<div class="image"><img src="image10.png" /></div>
<div class="image"><img src="image11.png" /></div>
<div class="image"><img src="image12.png" /></div>
...
<div class="image"><img src="image18.png" /></div>
</div>
. , , 9 . , , 9.
, 9 .
.