How to remove </li> closing tag and replace　with <ul> tag in jquery
<p>I am new guy in jquery. In my workplace, I need to be nested list view dynamically as shown in below.</p>

<pre><code>&lt;ul&gt;
    &lt;li&gt;
        Food
        &lt;ul&gt;
             &lt;li&gt;Apple&lt;/li&gt;
             &lt;li&gt;Orange&lt;/li&gt;
         &lt;\ul&gt;
    &lt;/li&gt;
   &lt;li&gt;
        Animals

    &lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<hr>

<p>Now in my code as follows:</p>

<pre><code>&lt;ul&gt;
    &lt;li&gt;
        Food
    &lt;/li&gt;

    &lt;ul&gt;&lt;\ul&gt;
    &lt;li&gt;Apple&lt;/li&gt;
    &lt;li&gt;Orange&lt;/li&gt;


   &lt;li&gt;
        Animals

    &lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>To be nested structure, I need to remove </li> closing tag and start with  to be nested structure. Although, I made web surfing there is no related examples with my problems. Some suggested to use regular expressions with javascript. But it doesn't working. Is there any idea, I am going to appreciate!!!</p>
