Unsere Freiwilligen haben diesen Artikel noch nicht in Deutsch übersetzt. Machen Sie mit und helfen Sie, das zu erledigen!
Sie können den Artikel auch auf English (US) lesen.

The lostpointercapture event is fired when a captured pointer is released.

Bubbles No
Cancelable No
Interface PointerEvent
Event handler property onlostpointercapture

Examples

This example listens for the lostpointercapture event, and captures the pointer for an element on pointerdown. When the user subsequently releases the pointer, the lostpointercapture event will be fired.

const para = document.querySelector('p');

document.addEventListener('lostpointercapture', () => {
  console.log('I\'ve been released!')
});

para.addEventListener('pointerdown', (event) => {
  para.setPointerCapture(event.pointerId);
});

The same example, but using the onlostpointercapture event handler property:

const para = document.querySelector('p');

document.onlostpointercapture = () => {
  console.log('I\'ve been released!')
};

para.addEventListener('pointerdown', (event) => {
  para.setPointerCapture(event.pointerId);
});

Specifications

Specification Status
Pointer Events Recommendation

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
lostpointercapture eventChrome Full support 57Edge ? Firefox Full support 59IE ? Opera Full support 44Safari ? WebView Android Full support 57Chrome Android Full support 57Firefox Android No support NoOpera Android Full support 43Safari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

See also

Schlagwörter des Dokuments und Mitwirkende

Mitwirkende an dieser Seite: mfuji09, mdnwebdocs-bot, wbamberg
Zuletzt aktualisiert von: mfuji09,