document.releaseCapture() turns off mouse capture if it is active on an element in this document. After release, mouse events stop being redirected to that element. Capture is enabled with element.setCapture().
Pass the required arguments shown below. Check return values and browser support before you rely on the result.
Syntax
Call document.releaseCapture. Start with this line.
JavaScript
document.releaseCapture()
Call
What it does
document.releaseCapture()
Primary signature.
document.releaseCapture(...)
Call with the arguments your case needs.
Built into the browser. Call releaseCapture(...) on document — no import required.
Library declarations
JavaScript
document.releaseCapture()
Parameters
This member has no parameters beyond those shown in the signature.
Return Value
Return Value
Description
*
Always undefined
JavaScript Examples
Example 1 — Feature-Detect releaseCapture
Most modern browsers omit this API — check before you call it.
Choose modern. For new products, ship the Pointer Events path.
Compatibility
Browser Support
Document.releaseCapture() is a legacy browser DOM API. MDN marks it Non-standard (not part of any specification). Support is limited; always feature-detect.
Bottom line: Learn it for legacy / interview context. For new drag and pointer UX, use setPointerCapture / releasePointerCapture. See the MDN Document.releaseCapture() reference.
Frequently Asked Questions
It releases mouse capture if capture is currently enabled on an element in this document. After release, mouse events are no longer all directed to that capturing element.
MDN marks Document.releaseCapture() as Non-standard (not part of any specification). The paired Element.setCapture() is marked Deprecated and Non-standard. Prefer Pointer Events for new code.
Call element.setCapture() (usually during mousedown). Document.releaseCapture() turns that capture off.
undefined. There are no parameters.
Use the Pointer Events API: element.setPointerCapture(pointerId) and element.releasePointerCapture(pointerId). MDN warns the old setCapture / releaseCapture pair never had much cross-browser support.
In supporting engines it is typically a safe no-op when capture is not active. Always feature-detect first — many modern browsers do not implement Document.releaseCapture().