--- title: GlobalEventHandlers.onpointerout slug: Web/API/GlobalEventHandlers/onpointerout translation_of: Web/API/GlobalEventHandlers/onpointerout ---
{{ApiRef("HTML DOM")}}

一个{{domxref("GlobalEventHandlers","global event handler")}} 用于处理 {{event("pointerout")}} 事件。

语法

var outHandler = targetElement.onpointerout;

返回值

outHandler
元素targetElement的指针输出事件处理程序。

例子

这个例子展示了两种方式来使用onpointerout设置元素的pointerout事件处理程序。

<html>
<script>
function outHandler(ev) {
 // Process the pointerout event
}
function init() {
 var el=document.getElementById("target1");
 el.onpointerout = outHandler;
}
</script>
<body onload="init();">
<div id="target1"> Touch me ... </div>
<div id="target2" onpointerout="outHandler(event)"> Touch me ... </div>
</body>
</html>

规范

Specification Status Comment
{{SpecName('Pointer Events 2','#widl-GlobalEventHandlers-onpointerout', 'onpointerout')}} {{Spec2('Pointer Events 2')}} Non-stable version
{{SpecName('Pointer Events', '#widl-GlobalEventHandlers-onpointerout', 'onpointerout')}} {{Spec2('Pointer Events')}} Initial definition

浏览器兼容性

{{Compat("api.GlobalEventHandlers.onpointerout")}}

相关链接