files/en-us/web/api/element/pointermove_event/index.md
{{APIRef("Pointer Events")}}
The pointermove event is fired when a pointer changes coordinates, and the pointer has not been canceled by a browser touch-action. It's very similar to the {{domxref("Element/mousemove_event", "mousemove")}} event, but with more features.
These events happen whether or not any pointer buttons are pressed. They can fire at a very high rate, depends on how fast the user moves the pointer, how fast the machine is, what other tasks and processes are happening, etc.
Use the event name in methods like {{domxref("EventTarget.addEventListener", "addEventListener()")}}, or set an event handler property.
addEventListener("pointermove", (event) => { })
onpointermove = (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.The event, which is of type {{domxref("PointerEvent")}}, provides all the information you need to know about the user's interaction with the pointing device, including the position, movement distance, button states, and much more.
To add a handler for pointermove events using {{domxref("EventTarget.addEventListener", "addEventListener()")}}:
const para = document.querySelector("p");
para.addEventListener("pointermove", (event) => {
console.log("Pointer moved");
});
You can also use the onpointermove event handler property:
const para = document.querySelector("p");
para.onpointermove = (event) => {
console.log("Pointer moved");
};
{{Specifications}}
{{Compat}}