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?
$(document).ready(function () {
var zipCodes = [60538, 60504];
$("#buttontest").click(function () {
var zipIndex = zipCodes.indexOf(parseInt($("#full_day").val()));
$("#zipMessage > div").hide("fast");
var zipId = zipIndex > -1 ? zipCodes[zipIndex] : "Error";
$("#zip" + zipId).show("fast");
});
});
Here is a working example; http://jsfiddle.net/7SPGh