I have a UL that contains any number of LIs. I am trying to create some jQuery code that will parse the original UL and wrap the UL and another LI after every 5 source LIs.
HTML launch:
<ul id="original_ul"> <li class="original_li">..</li> <li>..</li> <li>..</li> <li>..</li> <li>..</li> <li>..</li> <li>..</li> <li>..</li> <li>..</li> <li>..</li> </ul>
Required HTML:
<ul id="processed_ul"> <li class="new_wrap_li"> <ul class="new_wrap_ul"> <li class="original_li">..</li> <li>..</li> <li>..</li> <li>..</li> <li>..</li> </ul> </li> <li class="new_wrap_li"> <ul class="new_wrap_ul"> <li class="original_li">..</li> <li>..</li> <li>..</li> <li>..</li> <li>..</li> </ul> </li> </ul>
I use the .each function to go through the LIs and add them to the new processed ul stored inside the temporary div ... now I just need to wrap new LIs and ULs around every 5 LIs.
Thanks in advance!
Al
javascript jquery
Al.
source share