How can I close current ul and start new ul using jquery?
<p>Please see code below: There is a <code>ul</code> span generated dynamically using PHP code. After the 2nd span I close the current <code>ul</code> and start a new <code>ul</code>. How can I do this using jquery?</p>

<pre><code>&lt;ul class="menutop" id="menutop"&gt;
  &lt;span id="show_dynamic_0"&gt;    
    &lt;li class="item1 active root" id="item1 active root"&gt;
      &lt;a id="a-1309599451911317" class="orphan item bullet" href="http://localhost/health_phase2/"&gt;
        &lt;span&gt;Home&lt;/span&gt;
      &lt;/a&gt;
    &lt;/li&gt;
  &lt;/span&gt; 
  &lt;span id="show_dynamic_1"&gt;    
    &lt;li class="item2 root" id="item2 root"&gt;
      &lt;a id="a-1309599451912733" class="orphan item bullet" href="/health_phase2/index.php"&gt;
        &lt;span&gt;News Feed&lt;/span&gt;
      &lt;/a&gt;
    &lt;/li&gt;
  &lt;/span&gt; 
  &lt;!--Here I want to end menutop ul. After than start new ul. Means end current ul and start new ul --&gt; 
  &lt;!-- &lt;/ul&gt;&lt;ul&gt;  --&gt;
  &lt;span id="show_dynamic_2"&gt;    
    &lt;li class="item6 root" id="item6 root"&gt;
      &lt;a id="a-1309599451912287" class="orphan item bullet" href="/health_phase2/index.php?option=com"&gt;
        &lt;span&gt;Video&lt;/span&gt;
      &lt;/a&gt;
    &lt;/li&gt;
  &lt;/span&gt; 
  &lt;span id="show_dynamic_3"&gt;    
    &lt;li class="item7 root" id="item7 root"&gt;
      &lt;a id="a-1309599451913684" class="orphan item bullet" href="/health_phase2/index.php?option=com_content"&gt;
        &lt;span&gt;Interviews&lt;/span&gt;
      &lt;/a&gt;
    &lt;/li&gt;
  &lt;/span&gt; 
&lt;/ul&gt;
</code></pre>
