How to remove the end tag from a HTML string using JS
<p>I want to remove the end tag of a given HTML string. I get the HTML string from the document like so:</p>

<pre><code>var front = $('&lt;div&gt;').append($(clean_copy).contents().remove().end()).remove().html();
</code></pre>

<p>I now want to remove the <code>&lt;/div&gt;</code> from the below:</p>

<pre><code>&lt;div id="div1" style="font-size: 20px"&gt;&lt;/div&gt;
</code></pre>

<p>I am really rusty with regex but I want to try something like this:</p>

<pre><code>console.log("Remove End: " + front.replace('/&lt;(/)?div([^&gt;]*)&gt;/g', ''));
</code></pre>

<p>The above doesn't work, how can I remove <strong>any</strong> tag? Also some strings may not have an end tag.</p>
