不用submit 同样实现button 点击enter键进行提交

$(function(){
    document.onkeydown = function (e) {
    var theEvent = window.event || e;
    var code = theEvent.keyCode || theEvent.which;
    if (code == 13) {
        $(".logBtn").click();
    }
}; 

 

posted @ 2014-06-23 15:36  天道酬勤,坚持!  阅读(195)  评论(0编辑  收藏  举报