files/en-us/web/api/element/pointerover_event/index.md
{{APIRef("Pointer Events")}}
The pointerover event is fired when a pointing device is moved into an element's hit test boundaries.
pointerover events have the same problems as {{domxref("Element/mouseover_event", "mouseover")}}. If the target element has child elements, pointerout and pointerover events fire as the pointer moves over the boundaries of these elements too, not just the target element itself. Usually, {{domxref("Element/pointerenter_event", "pointerenter")}} and {{domxref("Element/pointerleave_event", "pointerleave")}} events' behavior is more sensible, because they are not affected by moving into child elements.
Use the event name in methods like {{domxref("EventTarget.addEventListener", "addEventListener()")}}, or set an event handler property.
addEventListener("pointerover", (event) => { })
onpointerover = (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("pointerover", (event) => {
console.log("Pointer moved in");
});
Using the onpointerover event handler property:
const para = document.querySelector("p");
para.onpointerover = (event) => {
console.log("Pointer moved in");
};
{{Specifications}}
{{Compat}}