title: e.preventDefault() not working on form submission
body: <p>When my HTML form is submitted, the webpage reloads even though I have the <code>e.preventDefault()</code> command in my submission function.</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>$("#room-code-form").addEventListener("submit", function(e) {
    e.preventDefault();
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;form id="room-code-form"&gt;
    &lt;input type="text" /&gt;
    &lt;input type="submit" /&gt;
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>