title: Extract the text out of HTML string using JavaScript
body: <p>I am trying to get the inner text of HTML string, using a JS function(the string is passed as an argument). Here is the code:</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>function extractContent(value) {
    var content_holder = "";
  
    for (var i = 0; i &lt; value.length; i++) {
      if (value.charAt(i) === '&gt;') {
        continue;
        while (value.charAt(i) != '&lt;') {
          content_holder += value.charAt(i);
        }
      }
  
    }
    console.log(content_holder);
  }
  
  extractContent("&lt;p&gt;Hello&lt;/p&gt;&lt;a href='http://w3c.org'&gt;W3C&lt;/a&gt;");</code></pre>
  </div>
  </div>
  </p>
  
  <p>The problem is that nothing gets printed on the <code>console(*content_holder* stays empty)</code>. I think the problem is caused by the <code>===</code> operator.</p>