title: How to make a HTML Parser in JavaScript
body: <p>I am very new to JavaScript and I have been tasked by my job to make a HTML Parser that can go through lines of a html file and find say an ID tag and then match it with an excel sheet (or CSV), and then swap the ID with a value from the spreadsheet / CSV file.</p>
  
  <p>NOTE: I am not asking you to do it for me; just I have looked through loads and I am just not aware of the right parser I need. A point in the right direction would be great thanks.</p>
  
  <p>Here is an example of a HTML document with IDs: (The ID's are prefixed with <strong>#IDHERE#</strong> as I don't know how to prefix an ID without the parser yet)</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      //Header Data Here
    &lt;/head&gt;
    &lt;body&gt;
      &lt;h1&gt;#ID_MainTitle#&lt;/h1&gt;
      &lt;p&gt;#ID_Para1#&lt;/p&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here is a table (Lua) (could be excel etc, but just for an example):</p>
  
  <pre><code>{
    ["ID_MainTitle"] = "Hello World",
    ["ID_Para1"] = "This is a test!",
  }
  </code></pre>
  
  <p>This would need to be the end result:</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      //Header Data Here
    &lt;/head&gt;
    &lt;body&gt;
      &lt;h1&gt;Hello World&lt;/h1&gt;
      &lt;p&gt;This is a test!&lt;/p&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I know it's not much help but I did have a look but none of the ones I found looked remotely like what I need.</p>