title: Trying to instantiate JavaScript class in a html file
body: <p>I'm trying to instantiate a JavaScript class in another HTML file. </p>
  
  <p>Here is the JavaScript class:</p>
  
  <pre><code>class Puzzle {
    constructor(fenStart, pgnEnd) {
      this.fenStart = fenStart;
      this.pgnEnd = pgnEnd;
    }
  }
  
  module.exports = Puzzle;
  </code></pre>
  
  <p>And here is the HTML file: </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;body&gt;
          &lt;script src="jquery-3.2.1.min.js"&gt;&lt;/script&gt;
          &lt;script src="class.js"&gt;&lt;/script&gt;
          &lt;p id="demo"&gt;&lt;/p&gt;
  
          &lt;script&gt;
              var demoEL = $('#demo');
  
              const x = new Puzzle("fenStart", "pgnEnd");
  
              demoEL.html(x.fenStart);
          &lt;/script&gt; 
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>However when ever I open the HTML file in chrome nothing appears on the page. And in the developer console I get the error "Uncaught ReferenceError: module is not defined, at class.js:8" How can I properly instantiate the puzzle class in this HTML file?</p>
  
  <p><strong>PS:</strong> I read that JQuery might be needed for this so I downloaded "jquery-3.2.1.min.js" and included it in the same folder as the JavaScript class and the HTML file. </p>