I get stuck when trying to implement recursive logic in jQuery--I don't have much practice with it. I have a simple need, which is to nest unsorted lists by class. What I have is two dynamic lists on a page (they're generated by two CAML queries). The first list will be the top level <li> and the second list will be nested. The first list has <li>s with numeric id's and the second list has <li>s with numeric classes that match the id's that they have to be nested under. i.e.:
<ul>
<li id="10">Parent Item 1</li>
<li id="14">Parent Item 2</li>
</ul>
<ul>
<li class="10">Child 1</li>
<li class="10">Child 2</li>
<li class="14">Child X</li>
</ul>
There will be an undetermined number of parents and child <li>s over time. Also, if it's better to use a different attr than class for the children that's fine. Ultimately I'll want to add more classes for CSS. Any help would be greatly appreciated.