title: Pass variable value from form javascript
body: <p>Say I got a HTML form like below and want to pass the values in the textfields to JS variables.</p>
  
  <pre><code>&lt;form name="testform" action="" method="?"
  &lt;input type="text" name="testfield1"/&gt;
  &lt;input type="text" name="testfield2"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I've only passed values to variables in PHP before. When doing it in javascript, do I need a method? And the main question, <strong>how is it done?</strong></p>