Element.releasePointerCapture() stops pointer capture that was set with setPointerCapture() for a given pointerId (MDN). After release, later pointer events follow normal hit-testing again. Returns undefined.
Pass the required arguments shown below. Check return values and browser support before you rely on the result.
Syntax
Call el.releasePointerCapture. Start with this line.
JavaScript
element.releasePointerCapture(pointerId)
Call
What it does
element.releasePointerCapture(pointerId)
Primary signature.
el.releasePointerCapture(...)
Call with the arguments your case needs.
Built into the browser. Call releasePointerCapture(...) on an Element — no import required.
Library declarations
JavaScript
element.releasePointerCapture(pointerId)
Parameters
Parameter
Description
pointerId
Required. Active pointer id from a PointerEvent
Return Value
Return Value
Description
*
Always undefined
JavaScript Examples
Example 1 — Release on pointerup
Capture on down; release on up and log the result.
Only release a live pointerId from an active event.
JavaScript
const el = document.getElementById("pad");
el.addEventListener("pointerdown", (e) => {
el.setPointerCapture(e.pointerId);
});
el.addEventListener("pointerup", (e) => {
try {
el.releasePointerCapture(e.pointerId); // OK — active pointer
} catch (err) {
console.log(err.name); // NotFoundError if id was stale
}
});
// Bad: fake id with no active pointer
// el.releasePointerCapture(999); → NotFoundError
Use the event’s id.e.pointerId matches an active pointer.
Stale / fake ids throw. MDN: NotFoundError.
Wrap in try/catch if you reuse stored ids or release twice.
Best practice: release inside the pointer handler with that event’s id.
Compatibility
Browser Support
Element.releasePointerCapture() is Baseline Widely available on MDN (across browsers since July 2020). Safe to use in modern drag and pointer UIs.
✓ Baseline Widely available
Element.releasePointerCapture()
Stop pointer capture for drag/slider controls — widely supported.
WideBaseline
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
Android WebViewSupported · Modern WebView
Full support
releasePointerCapture()Widely available
Bottom line: Call releasePointerCapture(e.pointerId) on pointerup after setPointerCapture. Prefer over deprecated releaseCapture().
Frequently Asked Questions
It releases (stops) pointer capture that was previously set for a specific pointer identified by pointerId (MDN).
No. MDN marks Element.releasePointerCapture() as Baseline Widely available (across browsers since July 2020). It is not Deprecated, Experimental, or Non-standard.
undefined. There is no return value (MDN).
The pointerId from a PointerEvent — typically event.pointerId from pointerdown, pointermove, or pointerup (MDN).
On pointerup, pointercancel, or when you cancel a drag early — after you previously called setPointerCapture(pointerId). Capture also ends automatically on pointerup (MDN).
NotFoundError DOMException if pointerId does not match any active pointer (MDN).