js enter键激发事件

document.onkeydown = function (e) {
            if (!e) e = window.event;
            if ((e.keyCode || e.which) == 13) {
                $("#btnSubmit").click();
            }
        }

posted @ 2014-06-27 00:59  SunRain117  阅读(3863)  评论(0编辑  收藏  举报