title: How do I access form data submitted by a user in Javascript?
body: <p>I'm relatively new to programming, but understand the basics of HTML, CSS, and Javascript (including jQuery).  Due to my greenness, I'd appreciate it if answers contained both a simple solution and a reason as to <i>why</i> the solution works.  Thanks!</p>
  
  <p>So I've got a form, with a text input and a submit button:</p>
  
  <pre><code>&lt;form&gt;
  &lt;input type="text"&gt;
  &lt;button type="submit"&gt;Submit&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>When the user types data into the text field and clicks submit, how do I gain access to this data?  If a user inputs their name, how do I grab that information?  I don't intend to store it or write it anywhere, just to hold onto it as a variable in javascript, which I'll assign to a jQuery cookie.</p>
  
  <p>So how do I access the data that the user has submitted, preferably using only Javascript (with jQuery)?  Thanks for the help!</p>