Hi everyone,
I'm hoping someone can help me with this problem. I've been using jQuery for a while now and can normally help myself with the documentation, but I can't find any way to actually do this.
What I want is to be able to split a div, or ul, or any other tag into two or more pieces, like so:
<ul class="my-list">
<li>One</li>
<li>Two</li>
<li>Three</li>
<li>Four</li>
<li>Five</li>
<li>Six</li>
<li>Seven</li>
<li>Eight</li>
</ul>
And what I want to end up with is this:
<ul class="my-list">
<li>One</li>
<li>Two</li>
<li>Three</li>
<li>Four</li>
</ul>
<ul class="my-list">
<li>Five</li>
<li>Six</li>
<li>Seven</li>
<li>Eight</li>
</ul>
At the moment I can't find any way to do this, because the before and after methods don't allow you to insert half of an HTML tag (i.e. *just* a closing tag and then *just* an opening tag). Can anyone think of a way to do this? It seems really simple, have I missed something?
Thanks
-mesonofgib