title: jQuery button submit with enter key function
body: <p>I have a button submit like this :</p>
  
  <pre><code>&lt;input type="button" id="button_sign_in" class="button_sign_in" value="Sign in"/&gt;
  </code></pre>
  
  <p>and I have jQuery submit like this :</p>
  
  <pre><code>$(document).ready(function()
      {
          $('#button_sign_in').click(function(){
               console.log('login');
              $.ajax
              ({
                  url: "login",
                  type: "post",
                  data: $('#login_form').serialize(),
                  dataType:'json',
                  success: function (data) 
                  {
                      if (data.status=='SUCCESS') 
                      {
                          window.location='home.php'; 
                      }
                      else 
                      {
                          $('#button_sign_in').shake(4,6,700,'#CC2222');
                          $('#username').focus();
                      }
                  },
                  error: function (e) {
                      console.log('error:'+e);
                  }
              });
          });
      });
  </code></pre>
  
  <p>The problem is : we can't submit using enter key, so user must click the button Sign in to submit.</p>
  
  <p>What I want ? set enter key into JS function, so user can choose submit using enter key or click the button Sign in.</p>
  
  <p>Thanks for any help.</p>