files/en-us/web/api/element/pointerup_event/index.md
{{APIRef("Pointer Events")}}
The pointerup event is fired when a pointer is no longer active. Remember that it is possible to get a pointercancel event instead.
This behavior is different from {{domxref("Element/mouseup_event", "mouseup")}} events. When using a physical mouse, mouseup events fire whenever any button on a mouse is released. pointerup events fire only upon the last button release; previous button releases, while other buttons are held down, don't fire pointerup events.
Use the event name in methods like {{domxref("EventTarget.addEventListener", "addEventListener()")}}, or set an event handler property.
addEventListener("pointerup", (event) => { })
onpointerup = (event) => { }
A {{domxref("PointerEvent")}}. Inherits from {{domxref("Event")}}.
{{InheritanceDiagram("PointerEvent")}}
This interface inherits properties from {{domxref("MouseEvent")}} and {{domxref("Event")}}.
PointerEvent.0 to 1, where 0 and 1 represent the minimum and maximum pressure the hardware is capable of detecting, respectively.-1 to 1, where 0 is the neutral position of the control.-90 to 90) between the Y–Z plane and the plane containing both the pointer (e.g., pen stylus) axis and the Y axis.-90 to 90) between the X–Z plane and the plane containing both the pointer (e.g., pen stylus) axis and the X axis.0 to 359.Using addEventListener():
const para = document.querySelector("p");
para.addEventListener("pointerup", (event) => {
console.log("Pointer up");
});
Using the onpointerup event handler property:
const para = document.querySelector("p");
para.onpointerup = (event) => {
console.log("Pointer up");
};
{{Specifications}}
{{Compat}}