We're looking for a person or people to help audit MDN to find places we could speed up. Is this you or someone you know? Check out the RFP: https://mzl.la/2IHcMiE


この記事はまだボランティアによって 日本語 に翻訳されていません。ぜひ MDN に参加して翻訳を手伝ってください!
この記事を English (US) で読むこともできます。

The global event handler for the pointerleave event, which is delivered to a Node when the pointer (mouse cursor, fingertip, etc.) exits its hit test area (for example, if the cursor exits an Element or Window's content area). This event is part of the Pointer Events API.


var leaveHandler = EventTarget.onpointerleave;

EventTarget.onpointerleave = leaveHandler;

Return value

The EventListener which will be invoked to handle pointerleave events sent to the target.


This example shows two ways to use onpointerleave to set an element's pointerleave event handler.

function leaveHandler(ev) {
 // Process the pointerleave event
function init() {
 var el=document.getElementById("target1");
 el.onpointerleave = leaveHandler;
<body onload="init();">
<div id="target1"> Touch me ... </div>
<div id="target2" onpointerleave="leaveHandler(event)"> Touch me ... </div>

See Using Pointer Events for additional details.


Specification Status Comment
Pointer Events – Level 2
The definition of 'onpointerleave' in that specification.
Working Draft Non-stable version
Pointer Events
The definition of 'onpointerleave' in that specification.
Recommendation Initial definition

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 35[1] 59 (59) 10 -ms
? No support
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? 35[1] 29.0 (29)[2] 10 -ms
? No support

[1] This was implemented in bug 248918.

[2] Supported behind the preference dom.w3c_pointer_events.enabled, defaulting to false.

See also


 このページの貢献者: chrisdavidmills, Sheppy, erikadoyle, jpmedley, rolfedh, Sebastianz, AFBarstow
 最終更新者: chrisdavidmills,