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) {  
        //此处编写用户敲回车后的代码  
    }  
}  

  

相关文章:

  • 2021-11-11
  • 2021-12-09
  • 2021-08-04
  • 2022-12-23
  • 2022-01-27
  • 2022-12-23
  • 2021-09-27
  • 2017-12-02
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案