jquery trigger event

前端 未结 3 1277
误落风尘
误落风尘 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:59

    You need to check if the $(this) really matches your button.

    Try replacing :

    $(this).trigger('click')
    

    With

    $('#continue').trigger('click')
    

提交回复
热议问题