代码示例:
document.onkeydown=function(event){ var e = event || window.event || arguments.callee.caller.arguments[0]; if (e && e.keyCode == 13 ) { alert("您按回车键了"); } }