how to unbind all event using jquery

后端 未结 4 1628
时光取名叫无心
时光取名叫无心 2020-12-02 10:46

i can use this code to remove click event,

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

but , has some method to remove all event ?

has a method nam

4条回答
  •  情话喂你
    2020-12-02 11:42

    You can call .unbind() without parameters to do this:

    $('p').unbind();
    

    From the docs:

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

提交回复
热议问题