键盘按键操作例子

按回车后调用CommonEvent
function PressEnterEvent(eve) {
    var currKey = 0, e = e || event;
    currKey = e.keyCode || e.which || e.charCode;
    if (currKey == 13) {
        CommonEvent(eve);
    }
    if (currKey == 46) {
        $(this).val("");
        CommonEvent(eve);
    }
}

原文地址:https://www.cnblogs.com/chjb/p/4971532.html