键盘监听事件


/*键盘Enter事件*/
document.onkeydown = function (e) {

var search = document.getElementById('DialogAddFeeItem_FeeItemSelect');

if (search == document.activeElement) {
//如果焦点在用户名或是密码文本框上
var theEvent = window.event || e;
//获取窗体的输入
var code = theEvent.keyCode || theEvent.which;
//如果输入了回车
if (code == 13) {

btnsearch.focus();
DialogAddFeeItem_SelectFeeItem();
}

}
//Tab = 9

 

 

}

posted on 2018-09-19 14:28  Smile向前  阅读(201)  评论(0编辑  收藏  举报