gpt4 book ai didi

jquery - 如何使用 jquery 取消绑定(bind)所有事件

转载 作者:IT王子 更新时间:2023-10-29 03:26:15 26 4
gpt4 key购买 nike

我可以使用这段代码来删除点击事件,

$('p').unbind('click')

但是,有什么方法可以删除所有事件吗?

在 jquery 中有一个名为 unbindAll 的方法吗?

谢谢

最佳答案

您可以调用.unbind()没有参数来做到这一点:

$('p').unbind();

来自 the docs :

In the simplest case, with no arguments, .unbind() removes all handlers attached to the elements.

关于jquery - 如何使用 jquery 取消绑定(bind)所有事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3569393/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com