Fire the same handlers with a single click on another control.
jQuery
$("#target").on("mouseup", function () {
console.log("Handler for mouseup called.");
});
$("#other").on("click", function () {
$("#target").trigger("mouseup");
});
mouseup fires when the mouse button is released while the pointer is over an element. Bind with .on("mouseup", handler) (jQuery 1.7+). Any HTML element can receive it.
Prefer .on("mouseup", handler). The .mouseup(handler) shorthand is deprecated since jQuery 3.3. To fire the event, use .trigger("mouseup") instead of .mouseup().
mouseup fires on release under the pointer. click needs both mousedown and mouseup inside the same element. Prefer click for normal buttons; use mouseup when you need release-time behavior.
Yes. Press outside, drag onto an element, then release — mouseup still fires on that element. The jQuery API notes most UIs do not treat this as a button press, so prefer click unless mouseup is intentional.
Call $(selector).trigger("mouseup"). That runs bound handlers. Use .triggerHandler("mouseup") to run handlers without bubbling or default actions.
Start on mousedown, finish on mouseup. For drag-end, listen on document — e.g. $(document).one("mouseup", fn) — so release anywhere ends the drag, not only over the handle.