How to find and replace begin tag and end tags in an html string using javascript/jquery
<p>How to find and replace begin tag and end tags in an html string using javascript/jquery</p>

<p>for example</p>

<pre><code>var myString = "&lt;span&gt; Hello john&lt;/span&gt;&lt;div&gt; John likes to play guitar &lt;/div&gt; &lt;div style="color:Blue;font-weight:bold" class='quotes'&gt;Anna likes to arrange flowers
        &lt;/div&gt;";
</code></pre>

<p>I need to find the "div" tag and replace with other html tag like "p" tag/ "span" tag</p>

<p>Resulting html string after replace "div" tag to "p" tag </p>

<pre><code>var replacestring="&lt;span&gt; Hello john&lt;/span&gt;&lt;p&gt; John likes to play guitar &lt;/p&gt; &lt;p style="color:Blue;font-weight:bold" class='quotes'&gt;Anna  likes to arrange flowers
            &lt;/p&gt;";
</code></pre>

<p>Please suggest any solution.</p>
