jQuery .mouseup() Method — Deprecated Shorthand

Beginner
5 min read
Updated: Oct 2026
5 examples
Live preview

What Is the .mouseup() Method?

.mouseup() is a shorthand for binding or triggering the mouseup event (button release). With a handler it binds; with no arguments it triggers. Prefer .on / .trigger in new code.

Remember
$("#box").mouseup(fn)           // bind (deprecated)
$("#box").mouseup(data, fn)     // bind + eventData (deprecated)
$("#box").mouseup()             // trigger (prefer .trigger)

// Modern:
$("#box").on("mouseup", fn)
$("#box").trigger("mouseup")
FormMeansPrefer
.mouseup(handler)Bind.on("mouseup", handler)
.mouseup(data, handler)Bind + data.on("mouseup", data, handler)
.mouseup()Trigger.trigger("mouseup")

How to Use .mouseup()

Know the three signatures, then map them to the modern API.

  1. Select element(s): $("#box").
  2. Bind (legacy): .mouseup(function (event) { ... }).
  3. Optional data (1.4.3+): .mouseup({ key: "v" }, handler) → event.data.
  4. Trigger (legacy): .mouseup() with no args — or use .trigger("mouseup").
PieceRequired?Role
handlerFor bindRuns on mouse button release
eventDataOptionalAvailable as event.data
No args—Triggers mouseup on the set
Return value—jQuery set (chainable)

Pseudocode

Pseudocode
function mouseup(element, handler?):
    if handler given:
        bind "mouseup" → handler   // like .on("mouseup", handler)
    else:
        trigger "mouseup"          // like .trigger("mouseup")

// Prefer naming the event explicitly with on / trigger

Cheat Sheet

Quick map from shorthand to modern calls.

LegacyModern
.mouseup(fn).on("mouseup", fn)
.mouseup(data, fn).on("mouseup", data, fn)
.mouseup().trigger("mouseup")
Unbind.off("mouseup")
Added1.0 (data form 1.4.3)
StatusDeprecated 3.3+

Live Preview

Run presets that show bind, eventData, and no-arg trigger via .mouseup().

Legacy demos for reading old code — prefer .on / .trigger in new projects.

Result
Handler ran via .mouseup(fn).

jQuery Examples

Short snippets for legacy .mouseup(). Prefer the modern forms in new work — use Try It Yourself to experiment.

Example 1 — Bind with .mouseup(handler)

Deprecated shorthand for .on("mouseup", handler).

jQuery
$("#target").mouseup(function () {
  console.log("Handler ran via .mouseup(fn).");
});
Try It Yourself

How It Works

  1. Select #target.
  2. .mouseup(fn) registers the callback (like .on("mouseup", fn)).
  3. User releases a mouse button while over the element.
  4. Handler runs at release time.

Example 2 — Pass eventData

Since 1.4.3: data object before the handler → event.data.

jQuery
$(".pad").mouseup({ phase: "end" }, function (event) {
  console.log("phase:", event.data.phase);
  console.log("id:", $(this).data("id"));
});
Try It Yourself

How It Works

  1. First arg is data, second is the handler.
  2. event.data holds that object inside the callback.
  3. this is still the released-over element.
  4. Modern: .on("mouseup", { phase: "end" }, fn).

Example 3 — Trigger with No Args

.mouseup() with no arguments fires the event — prefer .trigger("mouseup").

jQuery
$("#target").mouseup(function () {
  console.log("Handler for mouseup called.");
});

$("#fire").click(function () {
  $("#target").mouseup();  // same idea as .trigger("mouseup")
});
Try It Yourself

How It Works

  1. Bind a handler on #target.
  2. #fire listens for click.
  3. $("#target").mouseup() runs #target’s handlers.
  4. Prefer $("#target").trigger("mouseup") in new code.

Example 4 — Migrate to .on / .trigger

Side-by-side: same mouseup, recommended API.

jQuery
// Legacy
$("#legacy").mouseup(function () {
  console.log("via .mouseup(fn)");
});

// Modern (use this)
$("#modern").on("mouseup", function () {
  console.log("via .on(\"mouseup\", fn)");
});
Try It Yourself

How It Works

  1. Both listen for the same mouseup event.
  2. .mouseup(fn) is a thin wrapper around .on("mouseup", fn).
  3. .on supports delegation and is not deprecated.
  4. New projects should only use .on / .trigger / .off.

Example 5 — Pair with .mousedown()

Legacy press/release pair — migrate both sides to .on.

jQuery
$("p")
  .mousedown(function () {
    $(this).append(" Mouse down.");
  })
  .mouseup(function () {
    $(this).append(" Mouse up.");
  });
Try It Yourself

How It Works

  1. .mousedown(fn) appends on press (also deprecated).
  2. .mouseup(fn) appends on release.
  3. Order is down then up for a normal press.
  4. Modern: .on("mousedown", …).on("mouseup", …).

Edge Cases & Pitfalls

Common traps when reading or writing .mouseup() code.

deprecated

Do not use in new code

Binding forms are deprecated since 3.3. Teach and write .on("mouseup") instead.

vs-click

Release ≠ click

mouseup fires on release under the pointer; click needs press + release on the same element. Prefer click for most buttons.

overload

Bind vs trigger looks similar

.mouseup(fn) binds; .mouseup() triggers. Check the arguments before assuming.

delegation

No child-selector form

.mouseup() cannot do .on("mouseup", "li", fn). For dynamic lists, use .on with a selector.

drag

End drags on document

Handle-only .mouseup() misses releases outside the element. Prefer $(document).one("mouseup", fn).

Browser Support

.mouseup() has existed since jQuery 1.0 (eventData since 1.4.3). It still runs in jQuery 3.x browsers, but is deprecated since 3.3 — prefer .on("mouseup") / .trigger("mouseup").

✓ Deprecated 3.3+

.mouseup() shorthand

Works wherever jQuery event APIs work in the browser. Use on/trigger for new code.

100% Browser support
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 6+ · Legacy environments
Full support
Opera All modern versions
Full support
.mouseup() (legacy) Excellent (deprecated)

Bottom line: Migrate: .mouseup(fn) → .on("mouseup", fn); .mouseup() → .trigger("mouseup").

Performance Notes

ApproachCostNote
.mouseup(fn)Same as .onThin wrapper — no win
Many direct bindsHigher memoryPrefer delegated .on
No-arg .mouseup()Same as triggerName the event with .trigger

Switching to .on / .trigger does not slow you down — it clarifies intent and unlocks delegation.

Key Takeaways

  • Deprecated: .mouseup(handler) since jQuery 3.3.
  • Bind: use .on("mouseup", fn) instead.
  • Fire: use .trigger("mouseup"), not bare .mouseup().
  • Timing: release event — often for drag-end, not normal clicks.

One line: .mouseup() is a deprecated shorthand — prefer .on("mouseup") and .trigger("mouseup").

Frequently Asked Questions

With a handler — .mouseup(handler) or .mouseup(eventData, handler) — it binds a callback that runs when a mouse button is released over the element. With no arguments — .mouseup() — it triggers mouseup on each matched element. Binding forms are deprecated since jQuery 3.3.
Yes. Prefer .on("mouseup", handler) or .on("mouseup", eventData, handler) to bind, and .trigger("mouseup") to fire. jQuery 3.x still runs .mouseup() for compatibility.
.mouseup(handler) only registers a callback. .mouseup() with no arguments triggers the event (same idea as .trigger("mouseup")).
Replace .mouseup(fn) with .on("mouseup", fn). Replace .mouseup(data, fn) with .on("mouseup", data, fn). Replace no-arg .mouseup() with .trigger("mouseup").
mouseup fires on release under the pointer. click needs press and release inside the same element. Prefer click for normal buttons; use mouseup for release / drag-end behavior.
Since 1.4.3 you can pass data before the handler. It appears as event.data inside the callback. Modern form: .on("mouseup", eventData, handler).

Next: mouseenter event

Enter detection without bubbling into children.

mouseenter tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful