--- title: GlobalEventHandlers.ongotpointercapture slug: Web/API/GlobalEventHandlers/ongotpointercapture translation_of: Web/API/GlobalEventHandlers/ongotpointercapture ---
ongotpointercapture du mixin {{domxref("GlobalEventHandlers")}} est un {{event("Event_handlers", "event handler")}} qui traite les évènements de type {{event("gotpointercapture")}}.target.ongotpointercapture = functionRef;
functionRef est un nom de fonction ou une expression fonction. La fonction accepte un objet {{domxref("FocusEvent")}} en tant qu'unique argument.
function overHandler(event) {
// Obtient le gestionnaire de type "gotpointercapture" de la cible de l'événement
let gotCaptureHandler = event.target.ongotpointercapture;
}
function init() {
let el = document.getElementById('target');
el.ongotpointercapture = overHandler;
}
| Spécification | Status | Commentaire |
|---|---|---|
| {{SpecName('Pointer Events 2', '#the-gotpointercapture-event', 'onlostpointercapture')}} | {{Spec2('Pointer Events 2')}} |
{{Compat("api.GlobalEventHandlers.ongotpointercapture")}}
Document: gotpointercaptureElement: gotpointercapture