jquery trigger event

前端 未结 3 1279
误落风尘
误落风尘 2021-01-26 09:40

How can we call the trigger click event on a live object.

$(\"#continue\").live(\"keypress\",function(){
 if (e.which == 32 || e.which == 13) {
    $(this).trigg         


        
3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-26 09:55

    You use the argument "e", but never actually pass it in as an argument.

    $("#continue").live("keypress",function(){
    

    needs to be:

    $("#continue").live("keypress",function(e){
    

提交回复
热议问题