How to execute Jquery code only once??

后端 未结 9 2068
梦谈多话
梦谈多话 2020-12-16 15:52

I have one jquery method and i used call that method on click of a button . So in that code i have one line \" $(\"#loadingMessage\").css(\'padding-top\',\'6%\');

9条回答
  •  自闭症患者
    2020-12-16 16:27

    If you want to restrict #SearchButton click event to fire only once, use .one method

    $('#SearchButton').one('click', function() {
      ...
    });
    

提交回复
热议问题