title: Form input values are empty strings
body: <p>my problem is that I have empty input value after submitting a form.
  I have no errors and I have no idea what is wrong.</p>
  <p>Thanks!</p>
  <pre><code>const myForm = document.getElementById(&quot;myForm&quot;);
  const myName = document.getElementById(&quot;myName&quot;).value;
  const myEmail = document.getElementById(&quot;email&quot;).value;
  const myMessage = document.getElementById(&quot;message&quot;).value;
  
  myForm.addEventListener( &quot;submit&quot;, async (e) =&gt; {
      e.preventDefault();
  
      console.log( myName );
      console.log( myEmail );
      console.log( myMessage );
  })
  </code></pre>
  <pre><code>&lt;form id=&quot;myForm&quot; name=&quot;myForm&quot;&gt;
              
              &lt;label for=&quot;myName&quot;&gt;Name:&lt;/label&gt;
              &lt;input id=&quot;myName&quot; name=&quot;myName&quot; type=&quot;text&quot; &gt;
  
              &lt;label&gt;E-mail:&lt;/label&gt;
              &lt;input id=&quot;email&quot; name=&quot;email&quot; type=&quot;email&quot; &gt;
  
              &lt;label&gt;Message:&lt;/label&gt;
              &lt;textarea id=&quot;message&quot; name=&quot;message&quot; type=&quot;text&quot; &gt;&lt;/textarea&gt;
  
              &lt;button id=&quot;form-button&quot; type=&quot;submit&quot;&gt;Send&lt;/button&gt;
         
  &lt;/form&gt;
   
      
      &lt;script src=&quot;./mail-post.js&quot;&gt;&lt;/script&gt;
  </code></pre>