开发者

How come I can't bind this to JQuery?

    $("input").bind("keyup",function(e1){
                if(e1.keyCode==13){   
                 return false;        
                  }
            });

I want to return false everytim开发者_高级运维e someone pushes "enter" inside one of my text boxes.


k i tried it out this one works

$("textarea").bind("keypress", function(e) {
      if (e.keyCode == 13) return false;
    });

try with keycode 13 too


See jquery api

Your answer:

$('input').submit(function() {
  return false;
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜