I have a question Sort the list (you can use default JS/jquery sorting functions ) Break the sorted list apart into different sub-lists with a maximum of 'x' items each, 'x' being a parameter you pass in. The above sample result assumes x=2
<ul>
<li> 4 </li>
<li> 1 </li>
<li> 7 </li>
<li> 5 </li>
<li> 3 </li>
</ul>
Write a function to convert that to
<ul>
<li> 1 </li>
<li> 3 </li>
</ul>
<ul>
<li> 4 </li>
<li> 5 </li>
</ul>
<ul>
<li> 7 </li>
</ul>
Feel free to use any libraries/references you like within reason (i.e., don't use a library which has a "splitList" function). The key is to do this as efficiently as possible in terms of DOM manipulation.
i solved this question by creating separate list and deleted the original but I am wondering how can we do it by only modifying the existing one.(I mean modify on the fly while traversing)
`.
– Rob W Nov 10 '11 at 10:38