.mouseenter() is a shorthand for binding or triggering the mouseenter event (pointer enters; children do not re-fire). With a handler it binds; with no arguments it triggers. Prefer .on / .trigger in new code.
Optional data (1.4.3+): .mouseenter({ key: "v" }, handler) → event.data.
Trigger (legacy): .mouseenter() with no args — or use .trigger("mouseenter").
Piece
Required?
Role
handler
For bind
Runs when the pointer enters the element
eventData
Optional
Available as event.data
No args
—
Triggers mouseenter on the set
Return value
—
jQuery set (chainable)
Pseudocode
Pseudocode
function mouseenter(element, handler?):
if handler given:
bind "mouseenter" → handler // like .on("mouseenter", handler)
else:
trigger "mouseenter" // like .trigger("mouseenter")
// Prefer naming the event explicitly with on / trigger
Reference
Cheat Sheet
Quick map from shorthand to modern calls.
Legacy
Modern
.mouseenter(fn)
.on("mouseenter", fn)
.mouseenter(data, fn)
.on("mouseenter", data, fn)
.mouseenter()
.trigger("mouseenter")
Unbind
.off("mouseenter")
Added
1.0 (data form 1.4.3)
Status
Deprecated 3.3+
Try it
Live Preview
Run presets that show bind, eventData, and no-arg trigger via .mouseenter().
Legacy demos for reading old code — prefer .on / .trigger in new projects.
Result
Handler ran via .mouseenter(fn).
Code
jQuery Examples
Short snippets for legacy .mouseenter(). Prefer the modern forms in new work — use Try It Yourself to experiment.
Example 1 — Bind with .mouseenter(handler)
Deprecated shorthand for .on("mouseenter", handler).
jQuery
$("#target").mouseenter(function () {
console.log("Handler ran via .mouseenter(fn).");
});
.mouseenter() with no arguments fires the event — prefer .trigger("mouseenter").
jQuery
$("#target").mouseenter(function () {
console.log("Handler for mouseenter called.");
});
$("#fire").click(function () {
$("#target").mouseenter(); // same idea as .trigger("mouseenter")
});
.mouseenter(fn) is a thin wrapper around .on("mouseenter", fn).
.on supports delegation and is not deprecated.
New projects should only use .on / .trigger / .off.
Edge Cases & Pitfalls
Common traps when reading or writing .mouseenter() code.
deprecated
Do not use in new code
Binding forms are deprecated since 3.3. Teach and write .on("mouseenter") instead.
vs-over
Not the same as mouseover
mouseenter does not re-fire on children. Prefer it for parent hover with nested content.
overload
Bind vs trigger looks similar
.mouseenter(fn) binds; .mouseenter() triggers. Check the arguments before assuming.
delegation
No child-selector form
.mouseenter() cannot do .on("mouseenter", "li", fn). For dynamic lists, use .on with a selector.
Compatibility
Browser Support
.mouseenter() 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("mouseenter") / .trigger("mouseenter").
✓ Deprecated 3.3+
.mouseenter() shorthand
Works wherever jQuery event APIs work in the browser. Use on/trigger for new code.
Switching to .on / .trigger does not slow you down — it clarifies intent and unlocks delegation.
Remember
Key Takeaways
Deprecated:.mouseenter(handler) since jQuery 3.3.
Bind: use .on("mouseenter", fn) instead.
Fire: use .trigger("mouseenter"), not bare .mouseenter().
Behavior: enter-once — children do not re-fire.
One line:.mouseenter() is a deprecated shorthand — prefer .on("mouseenter") and .trigger("mouseenter").
Frequently Asked Questions
With a handler — .mouseenter(handler) or .mouseenter(eventData, handler) — it binds a callback that runs when the pointer enters the element. With no arguments — .mouseenter() — it triggers mouseenter on each matched element. Binding forms are deprecated since jQuery 3.3.
Yes. Prefer .on("mouseenter", handler) or .on("mouseenter", eventData, handler) to bind, and .trigger("mouseenter") to fire. jQuery 3.x still runs .mouseenter() for compatibility.
.mouseenter(handler) only registers a callback. .mouseenter() with no arguments triggers the event (same idea as .trigger("mouseenter")).
Replace .mouseenter(fn) with .on("mouseenter", fn). Replace .mouseenter(data, fn) with .on("mouseenter", data, fn). Replace no-arg .mouseenter() with .trigger("mouseenter").
mouseenter does not re-fire when the pointer moves into a child. mouseover does. Prefer mouseenter for parent hover with nested content.
Since 1.4.3 you can pass data before the handler. It appears as event.data inside the callback. Modern form: .on("mouseenter", eventData, handler).