Pick the overload that matches how precise you need the removal to be.
Attach with .bind(type, handler) (or migrate to .on()).
Store a named function if you need to remove that handler only.
Call .unbind(), .unbind(type), or .unbind(type, handler).
Prefer namespaces for plugins: .unbind(".myPlugin").
New code: use .off() with the same patterns.
Signature
Since
Role
.unbind()
1.0
Remove all handlers on the elements
.unbind(type)
1.0
Remove handlers for that event type
.unbind(type, handler)
1.0
Remove one specific function
.unbind(type, false)
1.4.3
Undo .bind(type, false)
.unbind(event)
1.0
Unbind the current handler from inside itself
Pseudocode
Pseudocode
call .unbind([eventType] [, handler | false])
or .unbind(eventObject)
for each matched element:
if no arguments:
remove every attached handler
else if eventObject:
remove the handler that matches this event
else if handler provided:
remove only that function for eventType
else if false:
remove the "return false" binding for eventType
else:
remove all handlers for eventType (and namespace if given)
return the jQuery collection
Reference
Cheat Sheet
Keep these facts handy when reading or migrating legacy event code.
Topic
Detail
Status
Deprecated since jQuery 3.0
Pairs with
.bind() (legacy)
Modern pair
.on() / .off()
Specific handler
Needs the same function reference
Namespace
.unbind("click.myEvents") or .unbind(".myEvents")
Self-unbind
.unbind(event) inside the handler
Anonymous fail
Two identical inline fns ≠ same reference
Try it
Live Preview
Bind and unbind a named click handler on the sample button — same idea as the official demo.
Sample target: the button below. After Bind, click it to fire the handler.
Result
Ready — pick an action and click Run.
Code
jQuery Examples
Short, copy-ready snippets. Prefer .off() when writing new code.
Example 1 — Official Bind / Unbind Demo
Attach a named click handler, then remove that same reference.
jQuery
function aClick() {
$("#log").text("Handler ran!");
}
$("#bind").on("click", function () {
$("#theone").bind("click", aClick).text("Can Click!");
});
$("#unbind").on("click", function () {
$("#theone").unbind("click", aClick).text("Does nothing...");
});
Bind → target responds to clicks
Unbind → target no longer runs aClick
How It Works
Name. Store aClick as a shared function.
Bind..bind("click", aClick) attaches it.
Unbind. Pass the same aClick to remove it.
Label. Update button text to show state.
Example 2 — Unbind by Event Type
Remove every click handler, or wipe all handlers on the element.
jQuery
$("p").bind("click", function () {
$("#log").text("clicked");
});
$("p").unbind("click"); // all click handlers
// $("p").unbind(); // every handler type
After .unbind("click") → clicks do nothing
.unbind() with no args removes all types
How It Works
Attach. Bind a click handler.
Type..unbind("click") clears all click handlers.
Broad. Bare .unbind() clears every type.
Careful. Broad removes can break other scripts on the same node.
Example 3 — Same Reference Required
Passing a new anonymous function does not remove the original handler.
jQuery
var foo = function () {
$("#log").text("foo ran");
};
$("button").bind("click", foo);
$("button").unbind("click", foo); // works
// Will NOT work — different function object:
// $("button").unbind("click", function () { … });
These mistakes show up most often with legacy unbind code.
deprecated
Do not use in new code
Migrate to .off(). It covers direct and delegated handlers.
reference
Anonymous twins do not match
Keep a named variable, or unbind by type/namespace.
proxy
Proxied handlers share one function
Unbinding a proxied handler can remove all proxied events on that element. Prefer unique namespaces (e.g. click.proxy1).
broad
Bare .unbind() is aggressive
It removes every handler. Prefer type + handler or a namespace in shared UI.
Compatibility
Browser Support
.unbind() has been part of jQuery since 1.0. Deprecated in 3.0 in favor of .off() (since 1.7). Still present in jQuery 3.x for legacy apps.
✓ Deprecated · jQuery 1.0+
jQuery .unbind()
Works wherever your jQuery build runs, but new code should use .off(). Prefer current jQuery 3.x+ with .on/.off.
100%jQuery core
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
.unbind()Legacy
Bottom line: Fine for reading old code. For new projects, always pair .on() with .off().
Analysis
Performance Notes
Approach
Cost
Best for
Precise .unbind(type, fn)
Cheap
Targeted cleanup
Namespace unbind
Cheap
Plugins / shared elements
Bare .unbind() often
Risky
Avoid on shared DOM nodes
Unbinding is inexpensive. The cost is accidental removal of other handlers — prefer named functions or namespaces.
Remember
Key Takeaways
Role: remove handlers attached with .bind().
Deprecated: use .off() for new code (since 1.7 / 3.0).
Precise: pass the same function reference or a namespace.
Self-remove:.unbind(event) from inside the handler.
One line:.unbind() is the legacy remover for .bind() — learn it to read old code, write .off() in new code.
Frequently Asked Questions
.unbind() removes event handlers attached with .bind(). You can remove all handlers, filter by event type, pass a specific handler reference, use namespaces, or pass an event object from inside a running handler.
Yes, but it has been deprecated since jQuery 3.0. Prefer .off() (available since 1.7) for new code.
Replace .bind(type, fn) with .on(type, fn) and .unbind(type, fn) with .off(type, fn). Namespace forms map the same way: .unbind(".myPlugin") → .off(".myPlugin").
JavaScript compares function references, not source text. .unbind("click", fn) needs the exact same fn passed to .bind(). Store the handler in a named variable.
.unbind() removes direct handlers from .bind(). .off() removes handlers from .on() — direct and delegated — and is the modern replacement for .unbind(), .undelegate(), and .die().
Bind with .bind("click.myEvents", fn), then .unbind("click.myEvents") removes only that binding, or .unbind(".myEvents") removes every handler in the namespace.