JavaScript Element pointerenter Event

Beginner
⏱️ 11 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
DOM event
Instance event

What You’ll Learn

The pointerenter event fires when a pointer enters an element’s hit-test area (including descendants). Learn addEventListener vs onpointerenter, how it mirrors mouseenter, why it differs from pointerover, the pointerleave pair, and five try-it labs.

01

Kind

Instance event

02

Type

PointerEvent

03

When

Pointer enters hit area

04

Handler

onpointerenter

05

Bubbles?

No (like mouseenter)

06

Status

Baseline widely available

Introduction

pointerenter answers: “Did a pointer just move into this element (or a descendant)?” It is the Pointer Events twin of mouseenter—unified for mouse, touch, and pen.

MDN notes that otherwise it works the same as mouseenter, and both are dispatched at the same time (with mouseover / pointerover when appropriate). Prefer the enter/leave pair for whole-component hover without descendant noise.

💡
Beginner tip

On devices without hover (many touchscreens), pointerenter can also fire as a result of pointerdown when contact lands inside the element.

Understanding pointerenter

An instance event that answers: “Did the pointer enter this element tree?”

  • Hit test — fires when the pointer enters the element or a descendant.
  • Does not bubble — like mouseenter / unlike pointerover.
  • No descendant re-fire — moving among children does not fire again on the parent.
  • Twin of mouseenter — dispatched together when mouse compatibility events apply.
  • Baseline Widely available on MDN (since July 2020).

📝 Syntax

Use the event name with addEventListener, or set the handler property:

JavaScript
addEventListener("pointerenter", (event) => { });

onpointerenter = (event) => { };

Event type

A PointerEvent (inherits from MouseEvent and Event).

Handy properties

PropertyMeaning
pointerIdUnique id for this pointer stream
pointerTypemouse, pen, touch, etc.
isPrimaryWhether this is the primary pointer of that type
clientX / clientYPointer position in the viewport
relatedTargetElement the pointer left (when available)

⚖️ pointerenter vs pointerover

Topicpointerenterpointerover
Bubbles?NoYes
Child boundariesIgnored for parent re-fireFires when moving among children
Mouse twinmouseentermouseover
Exit twinpointerleavepointerout
Best forWhole-component hover enterDelegated / bubbling enter tracking

For most UI hover enter/exit, MDN-style guidance favors pointerenter / pointerleave (or mouseenter / mouseleave) over the bubbling over/out pair.

🤳 Implicit Capture & Touch

On touchscreen browsers that allow direct manipulation, pointerdown can trigger implicit pointer capture. While capture is set, boundary events may be suppressed:

  • pointerover, pointerenter, pointerleave, and pointerout may not fire as expected.
  • Capture ends on pointerup / pointercancel, or when you call releasePointerCapture().
  • That is why a touch drag across neighbors may not look like mouse hover enter/leave.

⚡ Quick Reference

GoalCode / note
Listenel.addEventListener("pointerenter", fn)
Handler propertyel.onpointerenter = fn
Exit pairpointerleave
Bubbling alternativepointerover / pointerout
Mouse twinmouseenter (same timing when applicable)
MDN statusBaseline Widely available (Jul 2020)

🔍 At a Glance

Four facts to remember about pointerenter.

Event type
PointerEvent

MouseEvent + more

Means
entered

Hit area + kids

Bubbles
false

Like mouseenter

Baseline
yes

Since Jul 2020

Examples Gallery

Examples follow MDN Element: pointerenter event. Move a mouse or pen over the stage (or tap on touch).

📚 Getting Started

MDN listener patterns and the handler property.

Example 1 — Log pointerenter (MDN)

Fire when the pointer enters the paragraph.

JavaScript
const para = document.querySelector("p");
const out = document.getElementById("out");

para.addEventListener("pointerenter", (event) => {
  out.textContent = "Pointer entered element";
});
Try It Yourself

How It Works

The listener runs once when the pointer enters the element tree—not again for each child.

Example 2 — onpointerenter Property (MDN)

Same idea using the handler property form.

JavaScript
const para = document.querySelector("p");
const out = document.getElementById("out");

para.onpointerenter = (event) => {
  out.textContent = "onpointerenter at " + event.clientX + "," + event.clientY;
};
Try It Yourself

How It Works

Prefer addEventListener when you need multiple listeners or easy removal.

📈 Compare, Hover & IDs

See why enter beats over for parents, pair with leave, and log device type.

Example 3 — pointerenter vs pointerover

Move among child boxes and compare fire counts on the parent.

JavaScript
const parent = document.getElementById("parent");
const out = document.getElementById("out");
let enterCount = 0;
let overCount = 0;

parent.addEventListener("pointerenter", () => {
  enterCount++;
  render();
});

parent.addEventListener("pointerover", () => {
  overCount++;
  render();
});

function render() {
  out.textContent =
    "pointerenter=" + enterCount + " pointerover=" + overCount;
}
Try It Yourself

How It Works

pointerover fires at child boundaries; pointerenter stays quiet until you leave and re-enter the whole parent.

Example 4 — Hover Card with pointerleave

Show a tip on enter and hide it on leave—whole-component hover.

JavaScript
const card = document.getElementById("card");
const tip = document.getElementById("tip");

card.addEventListener("pointerenter", () => {
  tip.hidden = false;
  tip.textContent = "Preview details…";
});

card.addEventListener("pointerleave", () => {
  tip.hidden = true;
});
Try It Yourself

How It Works

Because enter/leave ignore descendant boundaries, the tip stays stable while you move over children inside the card.

Example 5 — Log pointerId and Type

See which device entered the stage.

JavaScript
const stage = document.getElementById("stage");
const out = document.getElementById("out");

stage.addEventListener("pointerenter", (event) => {
  out.textContent =
    "enter id=" + event.pointerId +
    " type=" + event.pointerType +
    " primary=" + event.isPrimary;
});
Try It Yourself

How It Works

Use pointerType when stylus vs mouse hover should behave differently.

🚀 Common Use Cases

  • Whole-component hover enter for mouse, pen, and (where applicable) touch.
  • Show previews, highlights, or tooltips without descendant flicker.
  • Pair with pointerleave instead of bubbling pointerover / pointerout.
  • Branch by pointerType when pen hover needs different feedback.
  • Teach Pointer Events enter/leave vs the mouseenter/mouseleave twins.

🔧 How It Works

1

Pointer outside

Hotspot is outside the element and its descendants.

Outside
2

Crosses hit area

Pointer moves in (or pointerdown lands for non-hover devices).

Boundary
3

pointerenter

Fires on the element; does not bubble; mouseenter may fire too.

Event
4

Stay until leave

Child moves do not re-fire; exit with pointerleave.

📝 Notes

  • MDN: Baseline Widely available (since July 2020) — no Deprecated / Experimental / Non-standard banner.
  • Does not bubble; pair with pointerleave for whole-component hover.
  • Dispatched with mouseenter when mouse compatibility events apply.
  • Implicit touch capture after pointerdown can suppress enter/leave until release.
  • Related learning: pointerdown, pointerleave, mouseenter, addEventListener(), JavaScript hub.

Browser Support

pointerenter is marked Baseline Widely available on MDN (since July 2020). Logos use the shared browser-image-sprite.png sprite from this project. Pointer Events unify mouse, touch, and pen across modern engines.

Baseline · Widely available

Element pointerenter

Fires when a pointer enters an element tree; does not bubble; pair with pointerleave for stable hover.

Full Widely available
Google Chrome Full support
Yes
Mozilla Firefox Full support
Yes
Apple Safari Full support
Yes
Microsoft Edge Full support
Yes
Opera Full support
Yes
Internet Explorer Pointer Events (legacy IE11 path)
Partial
pointerenter Baseline

Bottom line: Use pointerenter / pointerleave for whole-component hover. Prefer pointerover only when you need bubbling.

Conclusion

pointerenter is the unified “pointer entered this element tree” signal. Prefer it with pointerleave for stable hover on mouse, pen, and compatible touch paths.

Continue with pointerleave, pointerdown, mouseenter, or the JavaScript hub.

💡 Best Practices

✅ Do

  • Use pointerenter + pointerleave for whole-component hover
  • Prefer them over pointerover / pointerout when descendants should not re-fire
  • Remember the mouse twins: mouseenter / mouseleave
  • Account for implicit touch capture during active contact
  • Use pointerType when device-specific feedback matters

❌ Don’t

  • Expect pointerenter to bubble to parents
  • Assume enter/leave will fire during every touch drag (capture may suppress them)
  • Replace CSS :hover with JS unless you need extra logic
  • Confuse it with pointerover child-boundary behavior
  • Overwrite onpointerenter if you need multiple listeners

Key Takeaways

Knowledge Unlocked

Five things to remember about pointerenter

Pointer entered the element tree—non-bubbling hover for unified input.

5
Core concepts
📄02

PointerEvent

id · type · coords

API
03

vs pointerover

no bubble / no child noise

Compare
💡04

Pair

pointerleave

Pattern
🎯05

Baseline

since Jul 2020

Status

❓ Frequently Asked Questions

It fires when a pointing device moves into the hit test boundaries of an element or one of its descendants. That includes pointerdown from devices that do not support hover (such as many touchscreens).
No. MDN marks Element pointerenter as Baseline Widely available (since July 2020). It is not Deprecated, Experimental, or Non-standard.
A PointerEvent (inherits from MouseEvent and Event). Useful fields include pointerId, pointerType, isPrimary, clientX, and clientY.
pointerenter does not bubble and is not sent again when the pointer moves between the element and its descendants. pointerover bubbles and fires when moving among descendants.
MDN notes that otherwise pointerenter works the same as mouseenter and they are dispatched at the same time (along with mouseover / pointerover when appropriate).
On touchscreen browsers with direct manipulation, pointerdown can trigger implicit pointer capture. While capture is set, pointerover / pointerenter / pointerleave / pointerout may not fire until release or releasePointerCapture.
Did you know?

Spec tables list pointerenter as non-bubbling and non-cancelable (no default action)—just like pointerleave. That is why parent listeners never see a bubbled enter from a child.

Next: pointerleave

Learn the non-bubbling event when a pointer leaves an element.

pointerleave →

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.

5 people found this page helpful