兼容IE火狐的Enter回车快捷事件

//回车提交事件
            document.onkeydown = function (event) {
                e = event ? event : (window.event ? window.event : null);
                if (e.keyCode==13) {
                    var account = $.trim($("#txtAccount").val());
                    if (account == "") {
                        alert("账号不能为空");
                        $("#txtAccount").focus();
                        return;
                    }

                    var pwd = $.trim($("#txtPass").val());
                    if (pwd == "") {
                        alert("密码不能为空");
                        $("#txtPass").focus();
                        return;
                    }
                }
            }


版权声明:本文为xiaogechengxuyuan原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。