$(document).ready(function () { $(this).keypress(function (e) { switch (e.which) { case 13: alert("您按下了回车键"); break; //more detect } }); });