If I have a ul with 10 li elements in it, with jQuery what would be the quickest and least intensive way of splitting that group of lis into three uls (still within the original ul) to end up with something like this:
<ul>
<li>
<ul>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
<li>list item 4</li>
</ul>
<ul>
<li>list item 5</li>
<li>list item 6</li>
<li>list item 7</li>
</ul>
<ul>
<li>list item 8</li>
<li>list item 9</li>
<li>list item 10</li>
</ul>
</li>
</ul>
I tried using .wrap but that seemed to be wrapping every element in the list (understandable, it's an array after all), I'm currently thinking that creating the new uls and injecting the existing lis into them.
Any thoughts are welcome, I've not used jQuery much before. Thanks