The .mouseout() method is jQuery’s legacy shorthand for binding and triggering the mouseout event. This tutorial covers .mouseout(handler) since 1.0, .mouseout(eventData, handler) since 1.4.3, no-argument .mouseout() as a trigger, migration to .on("mouseout") and .trigger("mouseout"), and why the binding form is deprecated since jQuery 3.3. Because mouseout bubbles, handlers also fire when moving into nested children — for nested menus, prefer mouseleave. For the modern mouseout event API, see the jQuery mouseout event tutorial.
01
.mouseout(fn)
Bind handler
02
eventData
Since 1.4.3
03
.mouseout()
Trigger event
04
bubbles
Child crosses
05
.on()
Modern bind
06
Deprecated
Since 3.3
Fundamentals
Introduction
Before jQuery 1.7 unified events with .on() and .off(), every common event had a matching shorthand — .click(), .mouseout(), .keydown(), and dozens more. The .mouseout() method let you bind a hover-exit handler in one short call: $("#menu").mouseout(function(){ ... }). It remains in jQuery 3.x for backward compatibility but is marked deprecated.
Understanding .mouseout() matters when reading older card hover effects, tooltip plugins, and legacy tutorials. The method does two distinct jobs: with a function argument it binds; with no arguments it triggers. Unlike mouseleave, the mouseout event bubbles — a handler on #outer fires when the pointer moves into an inner child, not only when leaving the outer boundary entirely. Modern jQuery splits binding and triggering explicitly — .on("mouseout", handler) for binding and .trigger("mouseout") for firing. This page documents the shorthand API and shows how to migrate.
Concept
Understanding the .mouseout() Method
The official jQuery API describes .mouseout() as a way to bind an event handler to the mouseout event, or trigger that event on an element. When you pass a handler, jQuery registers it on each matched element and calls it when the pointer leaves that element — including when the pointer moves from the element into a nested child inside it, because mouseout bubbles.
When you call .mouseout() with no arguments, jQuery synthetically fires the mouseout event on each matched element. Bound handlers run immediately. This trigger behavior is equivalent to .trigger("mouseout").
⚠️
Deprecated since jQuery 3.3
Do not use .mouseout(handler) or .mouseout(eventData, handler) in new code. Replace them with .on("mouseout", handler) or .on("mouseout", eventData, handler). Replace no-argument .mouseout() with .trigger("mouseout"). For nested menus and tooltips, prefer mouseleave over mouseout. For bubbling, event.relatedTarget filtering, and modern patterns, read the jQuery mouseout event tutorial.
Foundation
📝 Syntax
The .mouseout() method has three signatures from the official jQuery API. The binding forms are deprecated; the trigger form remains valid but .trigger("mouseout") is preferred:
All .mouseout() signatures return the original jQuery object for chaining.
Handler return values are ignored unless you use return false (equivalent to preventDefault() + stopPropagation()).
Cheat Sheet
⚡ Quick Reference
Goal
Legacy (.mouseout)
Modern replacement
Bind mouseout handler
$("#box").mouseout(fn) ⚠
$("#box").on("mouseout", fn)
Pass data to handler
$("#box").mouseout({ action: "hide" }, fn) ⚠
$("#box").on("mouseout", { action: "hide" }, fn)
Pair over and out (legacy)
.mouseover(fnIn).mouseout(fnOut) — also deprecated; beware bubbling on nested content
Trigger mouseout programmatically
$("#outer").mouseout()
$("#outer").trigger("mouseout")
Remove mouseout handlers
$("#box").off("mouseout")
Prefer for nested menus
$("#nav").on("mouseleave", fn) instead of mouseout
Filter child crossings
if ($(event.relatedTarget).closest("#outer").length) return;
Compare
📋 .mouseout() vs .on("mouseout") vs .trigger("mouseout") vs mouseleave
Four related APIs — know which one binds, which one fires, and when bubbling makes mouseleave the better choice.
.mouseout()
deprecated
Legacy bind (.mouseout(fn)) or trigger (.mouseout()) — bubbles on child crossings
.on("mouseout")
bind
Modern binding since 1.7 — supports eventData and delegation; still bubbles
.trigger("mouseout")
fire
Programmatically run handlers — clearer than no-arg .mouseout()
mouseleave
no bubble
Preferred for nested menus — fires only when pointer exits the element entirely
Hands-On
Examples Gallery
Five examples cover binding, eventData, triggering, migration from .mouseout() to .on("mouseout"), and the legacy .mouseover() + .mouseout() hover pair. Use the Try-it links to run each snippet in the browser. Remember: binding with .mouseout(handler) is deprecated — these demos show legacy syntax you will encounter in older code.
📚 Binding & Triggering
Legacy .mouseout() signatures for binding handlers and firing events programmatically.
Example 1 — Bind Handler with .mouseout(handler) on #outer
The canonical legacy pattern — attach a function that runs when the pointer leaves the outer element. Because mouseout bubbles, the handler also fires when moving into the Inner child inside #outer.
Pointer leaves #outer entirely → log appends handler message
Moving into Inner child inside #outer → handler ALSO fires (bubbles)
For nested menus prefer .on("mouseleave", fn) — deprecated .mouseout(fn) for new code
How It Works
.mouseout(fn) registers the function on the element. jQuery internally routes this to .on("mouseout", fn). Unlike mouseleave, the handler runs when the pointer crosses from the outer surface into a child — that is the bubbling behavior that makes mouseout unreliable for nested menus.
Example 2 — Pass eventData with .mouseout(eventData, handler)
Since jQuery 1.4.3, pass an object before the handler — it arrives as event.data.
jQuery
$( ".tooltip" ).mouseout( { action: "hide" }, function( event ) {
var id = $( this ).data( "id" );
$( "#log" ).text(
"Hide: " + id + " | eventData.action: " + event.data.action
);
} );
Leave Help A → "Hide: help-a | eventData.action: hide"
Leave Help B → "Hide: help-b | eventData.action: hide"
Same handler, shared eventData on every .tooltip trigger
How It Works
jQuery stores the { action: "hide" } object and injects it into event.data when any matched tooltip trigger is left. Modern equivalent: .on("mouseout", { action: "hide" }, fn).
Example 3 — Trigger mouseout with No-Argument .mouseout()
Calling .mouseout() without a handler fires the mouseout event programmatically — triggered here from a click on #fire.
The first .mouseout(function(){ ... }) binds a handler on #outer. The second binds on #fire and calls $("#outer").mouseout() with no arguments — that synthetically fires mouseout. Replace with $("#outer").trigger("mouseout") for clarity.
📈 Migration & Legacy Hover Pair
Compare legacy and modern APIs, and highlight cards with deprecated shorthand methods.
Example 4 — Migration: .mouseout(fn) vs .on("mouseout", fn)
Both bind the same mouseout event — .on() is the recommended API for new code.
jQuery
$( "#legacy" ).mouseout( function() {
$( "#log" ).text( "Legacy: .mouseout(function(){ ... }) — deprecated since jQuery 3.3." );
} );
$( "#modern" ).on( "mouseout", function() {
$( "#log" ).text( "Modern: .on('mouseout', function(){ ... }) — use this for new code." );
} );
Leave #legacy → legacy deprecation message
Leave #modern → modern .on("mouseout") message
Behavior is identical — only the API name differs
How It Works
Under the hood, .mouseout(fn) calls .on("mouseout", fn). Migration is a straight rename with no behavior change for simple bindings. The advantage of .on() is delegation — $("#menu").on("mouseout", "li", fn) — which .mouseout() cannot do.
Example 5 — Legacy Hover: .mouseover() + .mouseout() on Cards
Add highlight on over, remove on out — the classic pre-mouseenter hover pair using deprecated shorthand methods. Works on flat cards; beware nested content inside each card.
Enter a .card → .highlight class added (.mouseover)
Leave the card → .highlight removed (.mouseout)
Nested caveat: moving between child elements inside a card re-fires mouseout/mouseover — use mouseenter/mouseleave or relatedTarget filter instead
How It Works
.mouseover(fn) handles the show half; .mouseout(fn) handles the hide half. On simple flat cards without nested children, this pair works fine. When cards contain buttons, icons, or nested spans, moving between those children triggers spurious out/over events — migrate to .on("mouseenter") + .on("mouseleave") for stable behavior. Both shorthand methods are deprecated since jQuery 3.3.
Applications
🚀 Common Use Cases
Reading legacy code — recognize $("#card").mouseout(fn) as equivalent to .on("mouseout", fn) in older hover plugins.
Legacy hover pairs — maintain existing .mouseover() / .mouseout() code on flat elements without nested children.
Flat row highlight — $("tr").mouseout(fn) on table rows with no nested interactive elements.
Automated testing — test suites may call .mouseout() to simulate exit — consider .trigger("mouseout") for explicit intent.
🧠 How .mouseout() Routes Through jQuery
1
You call .mouseout()
With a function argument, jQuery treats it as a bind request. With no arguments, it treats it as a trigger request.
dispatch
2
Bind path
.mouseout(handler) delegates internally to .on("mouseout", handler) — the handler is stored in jQuery’s event system and fires on leave and child crossings.
.on("mouseout")
3
Trigger path
No-arg .mouseout() delegates to .trigger("mouseout") — bound handlers run on each matched element.
.trigger("mouseout")
4
👉
jQuery object returned
Both paths return the original collection for chaining — .mouseout(fn).hide() works the same as .on("mouseout", fn).hide().
Important
📝 Notes
Deprecated since jQuery 3.3 — do not use .mouseout(handler) or .mouseout(eventData, handler) in new code. Use .on("mouseout") instead.
Bind with .mouseout(handler) since jQuery 1.0; eventData form since 1.4.3.
No-argument .mouseout() triggers the event since jQuery 1.0 — prefer .trigger("mouseout").
mouseout bubbles — handlers fire when moving from a parent into a child inside the bound element. For nested menus, prefer mouseleave.
.mouseout() does not support event delegation — use .on("mouseout", selector, fn) for dynamic lists.
Remove handlers with .off("mouseout") — not by calling .mouseout(undefined).
Legacy code using .mouseout() still runs in jQuery 3.x — migrate when you refactor those files.
Compatibility
Browser Support
jQuery simulates the mouseout event in every browser it supports. The .mouseout() method itself is a jQuery API — it works in jQuery 1.x, 2.x, and 3.x. Binding via .mouseout(handler) is deprecated since 3.3 but still functional; triggering via no-arg .mouseout() also remains supported.
✓ jQuery 1.0+
jQuery .mouseout() method
Supported across all jQuery versions you are likely to maintain. Deprecated binding since 3.3 — use .on('mouseout') for new projects. Native equivalent for binding: element.addEventListener('mouseout', fn).
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
.mouseout()Legacy API
Bottom line: Safe in legacy jQuery projects. Migrate bindings to .on('mouseout') and triggers to .trigger('mouseout') when updating code. Prefer mouseleave for nested menus.
Wrap Up
Conclusion
The jQuery .mouseout() method is the legacy shorthand for binding and triggering mouseout handlers. Use .mouseout(handler) or .mouseout(eventData, handler) to bind — both deprecated since jQuery 3.3. Use no-argument .mouseout() to trigger — equivalent to .trigger("mouseout").
For new code, prefer .on("mouseout", fn) for binding and .trigger("mouseout") for programmatic firing. Because mouseout bubbles, prefer mouseleave for nested menus. When you encounter .mouseout() in older projects, recognize it, understand it, and migrate when practical. For bubbling, event.relatedTarget filtering, and modern patterns, continue with the jQuery mouseout event tutorial.
Use .mouseout(fn) on menu containers with nested submenus
Swap mouseleave for mouseout without understanding bubbling
Confuse .mouseout(fn) (bind) with .mouseout() (trigger)
Copy deprecated patterns from old tutorials without modernizing them
Summary
Key Takeaways
Knowledge Unlocked
Six things to remember about .mouseout()
Legacy bind, modern migrate.
6
Core concepts
.mo01
.mouseout(fn)
Bind
Deprecated
data02
eventData
Since 1.4.3
Handler
()03
.mouseout()
Trigger
No args
bubble04
Bubbles
Child crosses
Caution
.on05
.on("mouseout")
Modern
Replace
3.306
Deprecated
Since 3.3
Migrate
❓ Frequently Asked Questions
The .mouseout() method has two roles. With a handler argument — .mouseout(handler) or .mouseout(eventData, handler) — it binds a function that runs when the pointer leaves the matched element or moves from the element into a nested child (because mouseout bubbles). With no arguments — .mouseout() — it triggers the mouseout event on each matched element, running bound handlers. Both forms have been part of jQuery since 1.0; the binding form is deprecated since 3.3.
Yes — the binding signatures .mouseout(handler) and .mouseout(eventData, handler) are deprecated since jQuery 3.3. Use .on('mouseout', handler) or .on('mouseout', eventData, handler) instead. The no-argument .mouseout() trigger form still works but .trigger('mouseout') is clearer and preferred in modern code. Existing legacy code continues to run in jQuery 3.x; migrate when you touch those files.
.mouseout(handler) registers a callback — it does not fire the event immediately. .mouseout() with no arguments triggers the mouseout event programmatically on every matched element, the same as .trigger('mouseout'). The handler form is deprecated for binding; the no-arg form is a trigger shorthand. Always check whether parentheses contain a function before reading legacy jQuery code.
The mouseout event bubbles. When the pointer leaves the outer element's surface to enter a child inside it, the browser fires mouseout on the outer element and the event bubbles up. That is why .mouseout(fn) on a menu container fires even though the user is still inside the menu. For nested menus and tooltips, prefer .on('mouseleave', fn) instead — mouseleave does not bubble and 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'). Replace .unbind('mouseout') cleanup with .off('mouseout'). Under the hood, .mouseout(handler) already delegates to .on('mouseout') — migration is a straight rename with no behavior change for simple bindings.
Yes. jQuery 3.x keeps .mouseout() for backward compatibility with jQuery 1.x and 2.x codebases. It still binds and triggers correctly. The API docs mark it deprecated to steer new projects toward .on() and .trigger(). Do not use .mouseout(handler) in new code — prefer the modern API covered in the jQuery mouseout event tutorial.
Did you know?
In deprecated .hover(handlerIn, handlerOut), the second argument handlerOut is literally a mouseleave handler — not a mouseout handler. jQuery never created a separate "hover" browser event. When you see legacy code like $("#nav").hover(showMenu, hideMenu), recognize that hideMenu runs on mouseleave, which does not bubble. Older code that chains .mouseover(fnIn).mouseout(fnOut) instead uses the bubbling mouseout event — a common source of flickering menus. Migrating means .on("mouseenter", showMenu).on("mouseleave", hideMenu).