callbacks.empty() removes all callbacks from a list (since jQuery 1.7). The official API: remove all of the callbacks from a list. The list stays reusable — you can add() again. Returns the same Callbacks object for chaining.
Remember
callbacks.add(foo)
callbacks.add(bar)
callbacks.empty()
callbacks.has(foo) → false
callbacks.has(bar) → false
callbacks.add(newFn) // still allowed
callbacks.fire() // runs newFn only
Call it when you want a clean slate but still need the same list object.
Register handlers with add() as usual.
Call empty() to wipe every handler in one step.
Optionally verify with has(fn) → false.
Re-add() new handlers and fire() when ready.
Piece
Required?
Role
Callbacks object
Yes
List to clear
Arguments
None
empty() takes no parameters
Return
—
Same Callbacks object (chainable)
Pseudocode
Pseudocode
list = [fn1, fn2, …]
empty():
if list is locked:
ignore
else:
list = [] // remove all handlers
return Callbacks // still active (unless disabled)
fire(args…):
for each fn in list:
call fn(args…) // no-op when list is []
Reference
Cheat Sheet
Keep these facts handy when resetting Callbacks lists.
Topic
Detail
Syntax
callbacks.empty()
Arguments
None
Effect
Removes every registered handler
Reusable?
Yes — add() / fire() still work
vs remove()
All vs specific references
vs disable()
Clear vs permanent shutdown
Since
jQuery 1.7
Try it
Live Preview
Compare clear, reuse, remove, and chain patterns on a fresh list.
Browser demo of callbacks.empty — same ideas as the examples below.
Result
add(foo, bar); empty(); fire()
→ (no output)
Code
jQuery Examples
Short, copy-ready snippets. Open DevTools Console, or use Try It Yourself for a live editor.
Example 1 — Clear All Callbacks
Add two handlers, call empty(), then fire() — silent.
Fluent API. Same pattern as other chainable Callbacks methods.
Edge Cases & Pitfalls
Check these before using empty() as a reset.
alive
List stays active
empty() is not disable(). New add() / fire() calls still work.
lock
Locked lists ignore empty()
After lock(), membership is frozen — empty() / add() / remove() do not change the list.
disable
Empty does not undo disable
If disable() already ran, clearing handlers does not re-enable firing.
memory
Flags stay the same
empty() does not change once / memory / unique behavior set at creation.
verify
Confirm with has()
After empty(), has(fn) returns false for previously registered references — the official check.
Compatibility
Browser Support
callbacks.empty() is part of jQuery’s Callbacks API (since 1.7). It works in any browser where your jQuery build runs — the list logic lives in jQuery, not as a separate browser API.
✓ jQuery 1.7+ · Browsers
jQuery callbacks.empty()
Supported in jQuery 1.x, 2.x, and 3.x across Chrome, Firefox, Safari, Edge, and other browsers with jQuery loaded.
100%With jQuery loaded
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
callbacks.empty()Browsers
Bottom line: Safe wherever jQuery is loaded. Use empty() to reset handlers; use disable() when the list must never fire again.
Analysis
Performance Notes
Operation
Cost
Best for
empty()
O(1) clear*
Full reset without naming handlers
remove(fn)
O(n) scan
Dropping one known reference
Many removes
O(n × k)
Prefer one empty() instead
*Implementation details vary, but clearing the whole list is cheaper than removing handlers one by one when you want none left. Reuse the same Callbacks object after empty() instead of allocating a new one every time — unless you also need different flags.
Remember
Key Takeaways
Role: wipe every handler in one call.
Reusable: the list stays active for new add() / fire().
vs remove: all handlers vs one reference.
Verify:has(fn) returns false after a successful clear.
One line:empty() resets the queue without killing the bus.
Frequently Asked Questions
empty() removes every handler from the Callbacks list in one call. After empty(), fire() runs nothing until you add() new functions. The list itself stays active — unlike disable(), which permanently shuts down firing.
remove(fn) drops specific function references you pass in. empty() wipes the entire list at once — useful when you want a clean slate without tracking each handler.
empty() clears handlers but the list can still accept add() and fire() afterward. disable() permanently prevents all future firing; disabled() stays true.
Yes. It returns the same Callbacks object, so you can chain: callbacks.empty().add(fn).fire().
Use has(fn) for a known reference — after empty(), has(foo) returns false for every previously registered function. That matches the official API example.
On a locked list, empty() is ignored (membership is frozen). On a disabled list, clearing handlers does not re-enable firing — disabled() stays true. Prefer empty() on active lists you plan to reuse.