$(function(){$(document).keydown(function(event){
if(event.keyCode==13){ alert("nihao"); }});$(document).keyup(function(event){ if(event.keyCode==13){ alert("nihao"); }});原文:https://www.cnblogs.com/xzybk/p/11548878.html