1.javascript版
document.onkeyup = function (e) { ?????if (window.event)//如果window.event对象存在,就以此事件对象为准 ?????????e = window.event; ?????var code = e.charCode || e.keyCode; ?????if (code == 13) { ?????????//此处编写用户敲回车后的代码 ?????} ?} ?
2.jquery版
document.onkeyup = function (e) { ?????if (window.event)//如果window.event对象存在,就以此事件对象为准 ?????????e = window.event; ?????var code = e.charCode || e.keyCode; ?????if (code == 13) { ?????????//此处编写用户敲回车后的代码 ?????} ?} ?
js捕获页面回车事件
原文地址:http://www.cnblogs.com/marshhu/p/7842767.html