.mouseover() is jQuery’s legacy shorthand for the mouseover 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 .mouseover(): bind handlers, pass eventData, trigger with no args, migrate to .on('mouseover') and .trigger('mouseover'), 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("mouseover", handler) instead of .mouseover(handler).
Step 3
Replace no-arg .mouseover() with .trigger("mouseover").
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 .mouseover(handler)
Log enter events with the deprecated binding shorthand — child crossings also fire.
jQuery
$("#outer").mouseover(function () {
$("#log").append("Handler for mouseover called.\n");
});
// Prefer: $("#outer").on("mouseover", function () { … });
Bind first. A handler must exist for the trigger to do anything useful.
Empty call fires..mouseover() synthesizes the event.
Same handlers run. Real enters and triggers share the callback.
Frequently Asked Questions
With a handler — .mouseover(fn) or .mouseover(eventData, fn) — it binds a function that runs when the pointer enters the element (and when moving into a child, because mouseover bubbles). With no arguments — .mouseover() — it triggers the event. Binding forms are deprecated since jQuery 3.3.
Yes. Prefer .on('mouseover', handler) for binding and .trigger('mouseover') for firing. jQuery 3.x still runs the shorthand for compatibility; migrate when you touch legacy code.
.mouseover(fn) only registers a callback. .mouseover() with no arguments fires the event on each matched element (same idea as .trigger('mouseover')). Check whether a function is passed before reading old code.
mouseover bubbles. Entering Inner from Outer still notifies Outer. For nested menus, prefer .on('mouseenter', fn) — mouseenter ignores child crossings.
Replace .mouseover(fn) with .on('mouseover', fn). Replace .mouseover(data, fn) with .on('mouseover', data, fn). Replace no-arg .mouseover() with .trigger('mouseover'). Unbind with .off('mouseover').
Yes for backward compatibility. It still binds and triggers correctly. Do not use it in new projects — use the modern mouseover event API, or mouseenter for nested UI.