How can I remove the event handler once the click event has fired?

后端 未结 4 1152
北荒
北荒 2020-12-12 07:13

I have a click event I wired up on a div on my page.

Once the click event has fired, I want to unbind the event on that

4条回答
  •  被撕碎了的回忆
    2020-12-12 07:47

    Taken from the jQuery documentation found here:

     $("#unbind").click(function () {
          $("#theone").unbind('click', aClick)
                      .text("Does nothing...");
        });
    

提交回复
热议问题