title: Parse an HTML string with JS
body: <p>I want to parse a string which contains HTML text. I want to do it in JavaScript.</p>
  <p>I tried the <a href="https://johnresig.com/blog/pure-javascript-html-parser/" rel="noreferrer">Pure JavaScript HTML Parser library</a> but it seems that it parses the HTML of my current page, not from a string. Because when I try the code below, it changes the title of my page:</p>
  <pre><code>var parser = new HTMLtoDOM(&quot;&lt;html&gt;&lt;head&gt;&lt;title&gt;titleTest&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;a href='test0'&gt;test01&lt;/a&gt;&lt;a href='test1'&gt;test02&lt;/a&gt;&lt;a href='test2'&gt;test03&lt;/a&gt;&lt;/body&gt;&lt;/html&gt;&quot;, document);
  </code></pre>
  <p>My goal is to extract links from an HTML external page that I read just like a string.</p>
  <p>Do you know an API to do it?</p>