--- title: GlobalEventHandlers.ongotpointercapture slug: Web/API/GlobalEventHandlers/ongotpointercapture tags: - API - Event Handler - GlobalEventHandlers - HTML DOM - Property - Reference - events - ongotpointercapture translation_of: Web/API/GlobalEventHandlers/ongotpointercapture ---
ongotpointercapture は {{domxref("GlobalEventHandlers")}} ミックスインのプロパティで、 {{event("gotpointercapture")}} イベントを処理する {{event("Event_handlers", "event handler")}} です。
target.ongotpointercapture = functionRef;
functionRef は、関数名または関数式です。 関数は {{domxref("PointerEvent")}} オブジェクトを唯一の引数として受け取ります。
function overHandler(event) {
// ターゲットイベントの gotpointercapture ハンドラを決定します
let gotCaptureHandler = event.target.ongotpointercapture;
}
function init() {
let el = document.getElementById('target');
el.ongotpointercapture = overHandler;
}
| 仕様書 | 状態 | 備考 |
|---|---|---|
| {{SpecName('Pointer Events 2', '#the-gotpointercapture-event', 'ongotpointercapture')}} | {{Spec2('Pointer Events 2')}} |
{{Compat("api.GlobalEventHandlers.ongotpointercapture")}}
Document: gotpointercapture イベントHTMLElement: gotpointercapture イベント