--- title: GlobalEventHandlers.onpointerup slug: Web/API/GlobalEventHandlers/onpointerup translation_of: Web/API/GlobalEventHandlers/onpointerup ---
pointerup
是一个全局的事件处理函数.
var upHandler = targetElement.onpointerup;
upHandler
targetElement
元素的pointerup
事件处理函数.如下是两种设置元素pointerup
事件处理函数的方法.
<html> <script> function upHandler(ev) { // 这里添加元素的pointup事件处理函数 } function init() { var el=document.getElementById("target1"); el.onpointerup = upHandler; } </script> <body onload="init();"> <div id="target1"> Touch me ... </div> <div id="target2" onpointerup="upHandler(event)"> Touch me ... </div> </body> </html>
Specification | Status | Comment |
---|---|---|
{{SpecName('Pointer Events 2','#widl-GlobalEventHandlers-onpointerup', 'onpointerup')}} | {{Spec2('Pointer Events 2')}} | Non-stable version |
{{SpecName('Pointer Events', '#widl-GlobalEventHandlers-onpointerup', 'onpointerup')}} | {{Spec2('Pointer Events')}} | Initial definition |