How to remove all click event handlers using jQuery?

后端 未结 5 2036
没有蜡笔的小新
没有蜡笔的小新 2020-12-01 02:18

I\'m having a problem. Basically, when a user clicks an \'Edit\' link on a page, the following Jquery code runs:

$(\"#saveBtn\").click(function () {
    save         


        
5条回答
  •  悲&欢浪女
    2020-12-01 03:12

    Is there a way to remove all previous click events that have been assigned to a button?

    $('#saveBtn').unbind('click').click(function(){saveQuestion(id)});
    

提交回复
热议问题