Events: also listen for lostpointercapture when capture ends.
Compatibility
Browser Support
Element.hasPointerCapture() is Baseline Widely available (MDN: across browsers since July 2020). Safe for modern teaching and production code.
✓ Baseline · Widely available
hasPointerCapture()
Return true or false depending on whether this element has capture for a pointerId.
WideBaseline
Google ChromeFull support
Supported
Mozilla FirefoxFull support
Supported
Apple SafariFull support
Supported
Microsoft EdgeFull support
Supported
OperaFull support
Supported
Internet ExplorerNot available
Unavailable
hasPointerCapture()Widely available
Bottom line: Use hasPointerCapture in drag/gesture code to confirm your element still owns the pointer.
Frequently Asked Questions
It returns a boolean indicating whether the element has pointer capture for the pointer identified by the given pointer ID (MDN).
No. MDN marks Element.hasPointerCapture() as Baseline Widely available (across browsers since July 2020). It is not Deprecated, Experimental, or Non-standard.
The pointerId from a PointerEvent object (for example event.pointerId from pointerdown, pointermove, or pointerup).
When the element currently holds pointer capture for that pointerId — typically after setPointerCapture(pointerId) and before releasePointerCapture(pointerId) or the pointer ends.
setPointerCapture() requests capture for a pointer. hasPointerCapture() only checks whether capture is already active on this element.
Useful in drag handlers: confirm your element still owns the pointer before handling further pointermove or pointerup events (MDN).