jQuery undelegate()メソッド

❮jQueryイベントメソッド

すべての要素からdelegate()メソッドで追加されたすべてのイベントハンドラーを削除します。

$("body").undelegate();

定義と使用法

undelegate()メソッドはバージョン3.0で非推奨になりました。代わりにoff()メソッドを使用してください 。

undelegate()メソッドは、 delegate()メソッドで追加された1つ以上のイベントハンドラーを削除します


構文

$(selector).undelegate(selector,event,function)

Parameter Description
selector Optional. Specifies the selector to remove event handlers from
event Optional. Specifies one or more event types to remove handler functions from
function Optional. Specifies a specific event handler function to remove

自分で試してみてください-例


を削除するundelegate()メソッドを使用して、すべての<p>要素のすべてのクリックイベントハンドラーを削除する方法。


undelegate()メソッドを使用して特定の関数のみを削除する方法。


❮jQueryイベントメソッド