How to split an element with jQuery when a class is matched?
<p>What I want is to be able to split an ul into two or more pieces, whenever the class "splithere" is matched. Then I need to wrap each part in a container. Like so:</p>

<pre><code>&lt;ul class="someclass"&gt;
    &lt;li&gt;One&lt;/li&gt;
    &lt;li&gt;Two&lt;/li&gt;
    &lt;li&gt;Three&lt;/li&gt;
    &lt;li class="splithere"&gt;Four&lt;/li&gt;
    &lt;li&gt;Five&lt;/li&gt;
    &lt;li&gt;Six&lt;/li&gt;
    &lt;li class="splithere"&gt;Seven&lt;/li&gt;
    &lt;li&gt;Eight&lt;/li&gt;
    &lt;li&gt;Nine&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>And what I want to end up with this:</p>

<pre><code>&lt;ul class="someclass"&gt;
    &lt;li class="newclass"&gt;
        &lt;ul&gt;
            &lt;li&gt;One&lt;/li&gt;
            &lt;li&gt;Two&lt;/li&gt;
            &lt;li&gt;Three&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li class="newclass"&gt;
        &lt;ul&gt;
            &lt;li class="splithere"&gt;Four&lt;/li&gt;
            &lt;li&gt;Five&lt;/li&gt;
            &lt;li&gt;Six&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li class="newclass"&gt;
        &lt;ul&gt;
            &lt;li class="splithere"&gt;Seven&lt;/li&gt;
            &lt;li&gt;Eight&lt;/li&gt;
            &lt;li&gt;Nine&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>I hope someone can help me...</p>
