title: How to strip specific tag into div in Javascript?
body: <p>I have this <strong>html</strong> code</p>
  
  <pre><code>&lt;div class="myDiv"&gt;
      &lt;a href="" title=""&gt;My link&lt;/a&gt;
      &lt;p&gt;This is a paragraph&lt;/p&gt;
      &lt;script&gt;//This is a script&lt;/script&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And I this <strong>javascript</strong>:</p>
  
  <pre><code>$('.myDiv').children().each(
    function() {
       var strToStrip = $('.myDiv').html();
       if ( this.tagName != 'A' ) {
          // Strip tag element if tagName is not 'A'
          // and replace &lt; or &gt; with &amp;lt; or &amp;gt;
          strToStrip.replace(/(&lt;([^&gt;]+)&gt;)(?!(a))/ig, "");
       }
    }
  </code></pre>
  
  <p>);</p>
  
  <p>How can I strip all tags, except from the <code>a</code> element? 
  I only need the link and strip tags if it is not a link tag.
  I can't find what wrong with this code and what regex can I use to do this.</p>
  
  <p>Any help please?</p>