title: How to remove html tag from string but keep html entities intact
body: <p>I would like to remove the HTML tags (element) from a string without touching the html entities such as &nbps; &amp; &eacute; &lt; etc..</p>
  
  <p>For now I am using this :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>stringWithTag = "&lt;i&gt; I want to keep my -&gt;&amp;nbsp;&lt;- element space, but remove the tags &lt;b&gt;Please Help&lt;/b&gt;&lt;/i&gt;";
      var div = document.createElement('div');
      div.innerHTML = stringWithTag;
      
      console.log("INPUT with html entity &amp;nbsp;");
      console.log(stringWithTag);
  
      htmlNoTag = div.textContent || div.innerText || "";
      console.log("\nOUTPUT that should still have entity &amp;nbsp;, but not...");
      console.log(htmlNoTag);</code></pre>
  </div>
  </div>
  </p>
  
  <p>cf jsfiddle : <a href="https://jsfiddle.net/az4st8LL/" rel="nofollow noreferrer">https://jsfiddle.net/az4st8LL/</a></p>
  
  <p>But I always miss the element entity (in that exemple &amp;nbsp should still be visible but it is not the case).
  I would like to avoid using a regex to remove all html tags if possible.</p>
  
  <p>Does anyone has a solution to this ?</p>
  
  <p>Thanks,</p>