document.onkeydown= function (e) {

var theEvent = window.event || e;
var code = theEvent.keyCode || theEvent.which;
if (code == 13) {
$("#uWorkplaceContent .btn-search").click();
}

}

1.键盘按键事件

2.IE6/7/8支持通过window.event获取对象

3.IE用event.keCode方法获取当前被按下的键盘按键值,而NetScape/FireFox/Opera用的则是event.which

4.13是Enter键的ASCII码值

5.绑定按钮的点击事件

相关文章:

  • 2021-11-17
  • 2022-12-23
  • 2021-11-30
  • 2022-03-05
猜你喜欢
  • 2021-12-14
  • 2022-12-23
  • 2021-08-02
  • 2021-09-08
  • 2021-08-02
  • 2021-10-15
  • 2022-12-23
相关资源
相似解决方案