title: Jquery: how to trigger click event on pressing enter key or clicking button
body: <p>I have a button that triggers a jquery event but only if the button is clicked. Is it possible to make it work if it is clicked or the return key is used?</p>
  
  <pre><code>$(document).ready(function () {
      var zipCodes = [60538, 60504];
      $("#buttontest").click(function () {
          var zipIndex = zipCodes.indexOf(parseInt($("#full_day").val()));
          $("#zipMessage &gt; div").hide("fast");
          var zipId = zipIndex &gt; -1 ? zipCodes[zipIndex] : "Error";
          $("#zip" + zipId).show("fast");
      });
  });
  </code></pre>
  
  <p>Here is a working example; <a href="http://jsfiddle.net/7SPGh" rel="nofollow">http://jsfiddle.net/7SPGh</a></p>