Group items with jQuery

Group items with jQuery

Hello,

I want to group every x objects with jQuery but I can't figure out how to do it.

I have:

  1. <div>
  2.       <div></div>
  3.       <div></div>
  4.       <div></div>
  5.       <div></div>
  6.       <div></div>
  7.       <div></div>
  8.       <div></div>
  9.       <div></div>
  10. </div>
And I want this:
  1. <div>
  2.       <div>
  3.             <div></div>
  4.             <div></div>
  5.             <div></div>
  6.             <div></div>
  7.       </div>
  8.       <div>
  9.             <div></div>
  10.             <div></div>
  11.             <div></div>
  12.             <div></div>
  13.       </div>
  14. </div>
I hope that you understand what I mean.