X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

jQuery undelegate() Method

jQuery Event Methods jQuery Event Methods

Example

Remove all event handlers added with the delegate() method from all elements:

$("body").undelegate();

Try it yourself »

Definition and Usage

The undelegate() method removes one or more event handlers, added with the delegate() method.

As of jQuery version 1.7, the on() and off() methods are preferred to attach and remove event handlers on elements.


Syntax

$(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


Examples

Try it Yourself - Examples

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

Remove a specific function added with delegate()
How to use the undelegate() method to remove only a specific function.


jQuery Event Methods jQuery Event Methods


Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook