Latest web development tutorials

jQuery undelegate () method

jQuery Event Methods jQuery Event Methods

Examples

() Method removes all event handlers from all elements by delegate:

$("body").undelegate();

try it"

Definition and Usage

undelegate () method to remove one or more of the delegate () method to add an event handler.

JQuery from version 1.7 onwards, ON () and off () method is the preferred method to add and remove event handlers on the elements.


grammar

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

参数 描述
selector 可选。规定需要删除事件处理程序的选择器。
event 可选。规定需要删除处理函数的一个或多个事件类型。
function 可选。规定要删除的具体事件处理函数。


Examples

More examples

Remove all click event handler
How undelegate () method to remove the click event for all <p> elements on the handler.

Remove the specified function by the delegate () to add
How undelegate () method removes only the specified function.


jQuery Event Methods jQuery Event Methods