JavaScript Element pointerout Event

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

What You’ll Learn

The pointerout event fires when a pointer leaves an element—and also at child boundaries (like mouseout). Learn addEventListener vs onpointerout, why pointerleave is often better, bubbling / relatedTarget, and five try-it labs.

01

Kind

Instance event

02

Type

PointerEvent

03

When

Leave + child edges

04

Handler

onpointerout

05

Bubbles?

Yes (like mouseout)

06

Status

Baseline widely available

Introduction

pointerout answers: “Did the pointer just leave this element (including into a covering child)?” It is the Pointer Events twin of mouseout—and it has the same child-boundary “noise.”

MDN recommends pointerenter / pointerleave for most whole-component hover exit, because they are not affected by moving into child elements. Use pointerout when you want bubbling or per-child leave tracking.

💡
Beginner tip

pointerout also fires after pointerup on devices without hover, after pointercancel, and when a pen leaves digitizer hover range—not only on mouse leave.

Understanding pointerout

An instance event that answers: “Did the pointer leave this target (or cross a child edge)?”

  • Hit test leave — pointer moved out of the element.
  • Child boundaries — also fires when entering/leaving descendants (like mouseout).
  • Bubbles — unlike pointerleave.
  • Extra triggers — non-hover pointerup, pointercancel, pen hover-range exit.
  • Baseline Widely available on MDN (since July 2020).

📝 Syntax

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

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

onpointerout = (event) => { };

Event type

A PointerEvent (inherits from MouseEvent and Event).

Handy properties

PropertyMeaning
targetElement the pointer left
relatedTargetElement the pointer entered (when available)
pointerIdUnique id for this pointer stream
pointerTypemouse, pen, touch, etc.
clientX / clientYPointer position in the viewport

⚖️ pointerout vs pointerleave

Topicpointeroutpointerleave
Bubbles?YesNo
Child boundariesFires when moving among childrenIgnored for parent re-fire
Mouse twinmouseoutmouseleave
Enter twinpointeroverpointerenter
Best forDelegation / per-child leaveWhole-component hover exit

MDN’s guidance matches the mouse pair: for most UI hover exit, prefer pointerleave (with pointerenter) over pointerout / pointerover.

🔔 When pointerout Fires

  • Pointer moves out of the element’s hit-test boundaries.
  • Pointer moves between parent and child (or among siblings)—child noise.
  • After pointerup on devices that do not support hover.
  • After pointercancel.
  • Pen stylus leaves the hover range detectable by the digitizer.

🤳 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().

⚡ Quick Reference

GoalCode / note
Listenel.addEventListener("pointerout", fn)
Handler propertyel.onpointerout = fn
Stable hover exitPrefer pointerleave
Enter twinpointerover
Where went?event.relatedTarget
MDN statusBaseline Widely available (Jul 2020)

🔍 At a Glance

Four facts to remember about pointerout.

Event type
PointerEvent

MouseEvent + more

Means
left target

Incl. child edges

Bubbles
true

Like mouseout

Baseline
yes

Since Jul 2020

Examples Gallery

Examples follow MDN Element: pointerout event. Move a mouse or pen onto the stage, then leave it (or move among children).

📚 Getting Started

MDN listener patterns and the handler property.

Example 1 — Log pointerout (MDN)

Fire when the pointer moves out of the paragraph.

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

para.addEventListener("pointerout", (event) => {
  out.textContent = "Pointer moved out";
});
Try It Yourself

How It Works

Leaving the paragraph (or entering a child that covers it) can trigger pointerout.

Example 2 — onpointerout Property (MDN)

Same idea using the handler property form.

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

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

How It Works

Prefer addEventListener when you need multiple listeners or easy removal.

📈 Compare, relatedTarget & IDs

See child-boundary noise, where the pointer went, and device type.

Example 3 — pointerout vs pointerleave

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

JavaScript
const parent = document.getElementById("parent");
const out = document.getElementById("out");
let outCount = 0;
let leaveCount = 0;

parent.addEventListener("pointerout", () => {
  outCount++;
  render();
});

parent.addEventListener("pointerleave", () => {
  leaveCount++;
  render();
});

function render() {
  out.textContent =
    "pointerout=" + outCount + " pointerleave=" + leaveCount;
}
Try It Yourself

How It Works

pointerout fires at child edges; pointerleave waits until you leave the whole parent.

Example 5 — Log pointerId and Type

See which device left the stage.

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

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

How It Works

Use pointerType when pen hover-range exit should behave differently from mouse leave.

🚀 Common Use Cases

  • Event delegation for leave tracking on many children.
  • Per-item highlight clear when the pointer exits each child.
  • Teaching the bubbling twin of mouseout under Pointer Events.
  • Reacting after pointercancel / non-hover pointerup boundary cleanup.
  • Prefer pointerleave instead for whole-card hover exit without flicker.

🔧 How It Works

1

Pointer over target

Hotspot is over an element (or a child is entered).

Inside
2

Boundary crossed

Leave the element, enter a child, cancel, or pen leaves hover range.

Trigger
3

pointerout

Fires on the left target and bubbles; mouseout may fire too.

Event
4

Handler runs

Use relatedTarget / target; or switch to pointerleave for quieter UX.

📝 Notes

  • MDN: Baseline Widely available (since July 2020) — no Deprecated / Experimental / Non-standard banner.
  • Bubbles; fires at child boundaries—same trade-offs as mouseout.
  • For whole-component exit, prefer pointerleave (with pointerenter).
  • Implicit touch capture after pointerdown can suppress over/out until release.
  • Related learning: pointermove, pointerover, pointerleave, addEventListener(), JavaScript hub.

Browser Support

pointerout 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 pointerout

Bubbling leave event with child-boundary noise; prefer pointerleave for whole-component hover exit.

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
pointerout Baseline

Bottom line: Use pointerout for delegation or per-child leave. Prefer pointerleave when child noise is unwanted.

Conclusion

pointerout is the unified bubbling “left this target” signal—useful for delegation, noisy at child edges. For stable whole-component hover exit, prefer pointerleave.

Continue with pointerover, pointerleave, pointermove, or the JavaScript hub.

💡 Best Practices

✅ Do

  • Prefer pointerleave for whole-component hover exit
  • Use pointerout when you need bubbling / per-child leave
  • Read relatedTarget to see where the pointer went
  • Remember the mouse twin: mouseout
  • Account for implicit touch capture during active contact

❌ Don’t

  • Expect quiet whole-card hover with pointerout alone
  • Ignore child-boundary flicker on nested UIs
  • Confuse it with non-bubbling pointerleave
  • Assume enter/leave/out will fire during every touch drag
  • Overwrite onpointerout if you need multiple listeners

Key Takeaways

Knowledge Unlocked

Five things to remember about pointerout

Bubbling leave with child noise—prefer pointerleave for quiet hover exit.

5
Core concepts
📄02

PointerEvent

relatedTarget · id

API
03

vs leave

bubbles / child noise

Compare
💡04

Prefer

pointerleave often

Pattern
🎯05

Baseline

since Jul 2020

Status

❓ Frequently Asked Questions

It fires when a pointer leaves an element’s hit-test area, when pointerup fires on devices without hover, after pointercancel, or when a pen leaves digitizer hover range. It also fires when moving among child boundaries.
No. MDN marks Element pointerout 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, relatedTarget, clientX, and clientY.
pointerout bubbles and also fires when moving from a parent into a child (or among child boundaries). pointerleave does not bubble and fires only when leaving the element and all descendants.
For whole-component hover exit without descendant noise, MDN notes pointerenter / pointerleave are usually more sensible than pointerover / pointerout.
When you want bubbling/delegation, or when you care about leaving individual children (for example highlighting each list item as the pointer exits it).
Did you know?

Spec tables list pointerout as bubbling and cancelable (unlike pointerleave, which is neither). That is why one parent listener can observe leave events from many nested children.

Next: pointerover

Learn the bubbling enter event and how it differs from pointerenter.

pointerover →

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