title: Form enter key and button click do different things
body: <p>I'm finding that when I submit my form by pressing the enter key, the page refreshes (because my form doesn't specify an action), but if I click the button, it executes the jQuery.</p>
  
  <p>How can I make an enter key press execute the jQuery as well?</p>
  
  <p>Here's my code:</p>
  
  <pre><code>&lt;form id="signup-form"&gt;
      &lt;input type="text" id="text-input-splash" class="text-input" placeholder="Enter your email"&gt;&lt;button type="button" id="submit-input-splash"&gt;Sign me up&lt;/button&gt;
  &lt;/form&gt;
  &lt;p id="validation-message"&gt;&lt;/p&gt;
  &lt;p&gt;100% private and free. No spam. One-click unsubscribe.&lt;/p&gt;
  &lt;script&gt;
      $(document).ready(function(){
          $("#submit-input-splash").click(function() {
              // import email variable
              var email = $("#text-input-splash").val();
              $.post("signup.php", {email: email}, function(data){
                  $("#validation-message").text(data).addClass("error-text");
              });
          });
      });
  &lt;/script&gt;
  </code></pre>