Description
The .undelegate() method removes an event handler from selected elements, now or in the future.
v1.4.2
This method has the form:
.undelegate()
Return Value
This form returns a jQuery object.
v1.4.2
This method has the alternate form:
.undelegate(selector,event)
Parameter | Description |
---|---|
selector | (required) Specifies one or more child elements to remove the event handler from |
event | (required) A string containing one or more space-separated JavaScript event types |
function | (required) Specifies the function to run when the event(s) occur |
Return Value
This form returns a jQuery object.
v1.4.2
This method has the alternate form:
.undelegate(selector,event,function)
Parameter | Description |
---|---|
selector | (required) Specifies one or more child elements to remove the event handler from |
event | (required) A string containing one or more space-separated JavaScript event types |
function | (required) Specifies the function to run when the event(s) occur |
Return Value
This form returns a jQuery object.
v1.6
This method has the alternate form:
.undelegate(namespace)
Parameter | Description |
---|---|
namespace | (required) Specifies a string containing a namespace to unbind all events from |
Return Value
This form returns a jQuery object.
Examples
Remove the event that hides or shows a p element when a button is clicked:
$("div").undelegate("button",
"click",function(){
$("p").slideToggle();
});