跳转输入框按键操作

        //跳转输入框按键操作
        this.keypress_gopage = function() {
            var event = arguments[0] || window.event;
            var code = event.keyCode || event.charCode;
            //delete key
            if (code == 8) return true;
            //enter key
            if (code == 13) {
                this.gopage();
                return false;
            }
            //copy and paste
            if (event.ctrlKey && (code == 99 || code == 118)) return true;
            //only number key
            if (code < 48 || code > 57) return false;
            return true;
        }

 

posted @ 2015-12-24 16:23  扬帆丶远航  阅读(238)  评论(0编辑  收藏  举报