.mouseout() is jQuery’s legacy shorthand for the mouseout event (since 1.0). Pass a handler to bind; call it with no arguments to trigger. Binding forms are deprecated since 3.3 — prefer .on() / .trigger().
Syntax
Start with these common calls. Keep them short and readable.
Learn jQuery .mouseout(): bind handlers, pass eventData, trigger with no args, migrate to .on('mouseout') and .trigger('mouseout'), bubbling pitfalls, examples, and FAQs. Deprecated since 3.3.
Load jQuery before your script (CDN or local file), then wrap DOM work in $(function () { ... }) when needed.
Parameters
Parameter
Description
Step 1
Decide if the call is a bind (function passed) or a trigger (no args).
Step 2
For new work, use .on("mouseout", handler) instead of .mouseout(handler).
Step 3
Replace no-arg .mouseout() with .trigger("mouseout").
Return Value
Return Value
Description
jQuery object
Most setters and traversing helpers return the jQuery collection so you can chain more methods.
jQuery Examples
Example 1 — Bind with .mouseout(handler)
Log leave events with the deprecated binding shorthand — child crossings also fire.
jQuery
$("#outer").mouseout(function () {
$("#log").append("Handler for mouseout called.\n");
});
// Prefer: $("#outer").on("mouseout", function () { … });
Bind first. A handler must exist for the trigger to do anything useful.
Empty call fires..mouseout() synthesizes the event.
Same handlers run. Real leaves and triggers share the callback.
Frequently Asked Questions
With a handler — .mouseout(fn) or .mouseout(eventData, fn) — it binds a function that runs when the pointer leaves the element (and when moving into a child, because mouseout bubbles). With no arguments — .mouseout() — it triggers the event. Binding forms are deprecated since jQuery 3.3.
Yes. Prefer .on('mouseout', handler) for binding and .trigger('mouseout') for firing. jQuery 3.x still runs the shorthand for compatibility; migrate when you touch legacy code.
.mouseout(fn) only registers a callback. .mouseout() with no arguments fires the event on each matched element (same idea as .trigger('mouseout')). Check whether a function is passed before reading old code.
mouseout bubbles. Leaving Outer into Inner still notifies Outer. For nested menus, prefer .on('mouseleave', fn) — mouseleave ignores child crossings.
Replace .mouseout(fn) with .on('mouseout', fn). Replace .mouseout(data, fn) with .on('mouseout', data, fn). Replace no-arg .mouseout() with .trigger('mouseout'). Unbind with .off('mouseout').
Yes for backward compatibility. It still binds and triggers correctly. Do not use it in new projects — use the modern mouseout event API, or mouseleave for nested UI.