How to remove all click event handlers using jQuery?

后端 未结 5 1987
没有蜡笔的小新
没有蜡笔的小新 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 02:55

    If you used...

    $(function(){
        function myFunc() {
            // ... do something ...
        };
        $('#saveBtn').click(myFunc);
    });
    

    ... then it will be easier to unbind later.

提交回复
热议问题