jQuery mouseenter Event — Enter Without Child Bubbling

Beginner
5 min read
Updated: Oct 2026
4 examples
Live preview

What Is the mouseenter Event?

mouseenter fires when the pointer enters the element it is bound to. Moving into a child does not fire it again (unlike mouseover). Bind with .on("mouseenter", handler) (jQuery 1.7+).

Remember
$("#outer").on("mouseenter", function () { ... })
$("#outer").trigger("mouseenter")

// Enter element → fires once
// Enter a child inside it → does NOT fire again
// Prefer on/trigger — not the deprecated .mouseenter()
NeedUse
Bind handler.on("mouseenter", handler)
Fire event.trigger("mouseenter")
Leave the elementmouseleave
Also fire on childrenmouseover

How to Use mouseenter

Select the container, bind enter (and usually leave), avoid mouseover when children would spam handlers.

  1. Select the element(s): $("#outer"), $(".card"), etc.
  2. Bind: .on("mouseenter", function (event) { ... }).
  3. Pair with .on("mouseleave", …) for hover-style UI.
  4. To fire in code: .trigger("mouseenter"). Unbind with .off("mouseenter").
PieceRequired?Role
"mouseenter"YesEvent type string for .on / .trigger
handlerYes (bind)Runs when the pointer enters the element
eventDataOptionalExtra data passed into the handler
Return value—jQuery set (chainable)

Pseudocode

Pseudocode
function onMouseenter(element, handler):
    when pointer moves from outside element → inside element:
        handler(event)
    // moving into a child of element does NOT call handler again

trigger(element, "mouseenter"):
    run all mouseenter handlers on element

Cheat Sheet

Keep these facts handy when choosing enter vs over.

TopicDetail
Bind.on("mouseenter", handler) (1.7+)
Trigger.trigger("mouseenter") (1.0+)
WhenPointer enters the bound element
vs mouseoverDoes not re-fire on children
Pairmouseleave / .hover()
Unbind.off("mouseenter")
Deprecated.mouseenter() shorthand (3.3+)

Live Preview

Run presets that use .on("mouseenter") and .trigger("mouseenter").

Uses .on("mouseenter") and .trigger("mouseenter") — same ideas as the examples below.

Result
Handler for mouseenter called.

jQuery Examples

Short, copy-ready snippets. Open DevTools Console, or use Try It Yourself for a live editor.

Example 1 — Bind a mouseenter Handler

Official style: .on("mouseenter", …) on a container.

jQuery
$("#outer").on("mouseenter", function () {
  console.log("Handler for mouseenter called.");
});
Try It Yourself

How It Works

  1. Select #outer.
  2. Bind with .on("mouseenter", handler).
  3. Pointer enters the element from outside.
  4. Handler runs once for that enter — not again for children.

Example 2 — Trigger mouseenter from Code

Fire the same handlers with a click on another control.

jQuery
$("#outer").on("mouseenter", function () {
  console.log("Handler for mouseenter called.");
});

$("#other").on("click", function () {
  $("#outer").trigger("mouseenter");
});
Try It Yourself

How It Works

  1. Bind the real handler on #outer.
  2. Another control listens for click.
  3. trigger("mouseenter") runs #outer’s handlers.
  4. Same message as moving the pointer into #outer.

Example 3 — mouseenter vs mouseover

Entering a child re-fires mouseover, not mouseenter.

jQuery
var enterCount = 0;
var overCount = 0;

$("#enterBox").on("mouseenter", function () {
  enterCount += 1;
  console.log("mouseenter:", enterCount);
});

$("#overBox").on("mouseover", function () {
  overCount += 1;
  console.log("mouseover:", overCount);
});
// Move into each box, then into its Inner child:
// mouseenter stays 1; mouseover increases again.
Try It Yourself

How It Works

  1. mouseenter counts only entering the bound box.
  2. mouseover also fires when you enter the Inner child.
  3. Choose mouseenter for stable hover on parents with children.
  4. Official tip. Child moves usually make mouseover undesirable.

Example 4 — Pair With mouseleave

Enter and leave without child noise — classic hover pair.

jQuery
$("#card")
  .on("mouseenter", function () {
    console.log("mouse enter");
  })
  .on("mouseleave", function () {
    console.log("mouse leave");
  });
Try It Yourself

How It Works

  1. mouseenter runs when the pointer enters #card.
  2. mouseleave runs when it leaves #card.
  3. Children inside #card do not toggle these twice.
  4. Shortcut. .hover(enter, leave) wires both.

Edge Cases & Pitfalls

Most bugs come from using mouseover when you meant mouseenter.

children

Do not use mouseover for parent hover

Nested elements re-fire mouseover. Prefer mouseenter / mouseleave for cards and menus.

deprecated

Avoid .mouseenter() in new code

Use .on("mouseenter") / .trigger("mouseenter"). The method shorthand is deprecated since 3.3.

touch

No true hover on touch

Pointer enter/leave is mouse-oriented. Provide click/tap paths for touch UIs.

simulate

jQuery normalizes the event

Originally IE-only; jQuery simulates mouseenter so it works in all supported browsers.

Browser Support

.on("mouseenter") has shipped since jQuery 1.7 (.trigger("mouseenter") since 1.0). jQuery simulates mouseenter so it works in all modern browsers with jQuery loaded.

✓ jQuery 1.7+

mouseenter event

Pointer enters the bound element — without re-firing on child elements.

100% Browser support
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 6+ · Legacy environments
Full support
Opera All modern versions
Full support
mouseenter Excellent

Bottom line: Bind with .on("mouseenter"). Prefer it over mouseover when the element has children.

Performance Notes

ApproachCostBest for
mouseenterFewer callsParent hover with children
mouseoverMore callsWhen you truly need child enters
Heavy work in handlerJanky hoverKeep enter/leave light

Prefer mouseenter / mouseleave for UI hover — fewer accidental re-entries means less work and cleaner state.

Key Takeaways

  • Role: pointer enters the bound element.
  • vs over: children do not re-fire mouseenter.
  • API: use .on / .trigger, not the shorthand.
  • Pair: mouseleave or .hover().

One line: .on("mouseenter") for enter-once hover — use it when the element has children.

Frequently Asked Questions

mouseenter fires when the pointer enters the bound element. Unlike mouseover, moving into a child does not fire it again. Bind with .on("mouseenter", handler) (jQuery 1.7+). jQuery simulates the event across browsers.
Prefer .on("mouseenter", handler). The .mouseenter(handler) shorthand is deprecated since jQuery 3.3. To fire the event, use .trigger("mouseenter") instead of .mouseenter().
mouseover bubbles and also fires when the pointer moves from parent into a child. mouseenter does not — it fires once when entering the element it is bound to, not when entering descendants.
Use mouseleave for when the pointer leaves the element (same non-child-bubbling behavior). .hover(enterFn, leaveFn) is a convenience that wires both.
Call $(selector).trigger("mouseenter"). That runs bound handlers without needing a real pointer move.
No — that is the point versus mouseover. Handlers on an ancestor are not triggered by entering a descendant of the bound element.

Next: .mouseenter() shorthand

See the deprecated method form — then keep using .on / .trigger.

.mouseenter() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful