Firefox Tomorrow

web api event

Element: pointerenter event

View on MDN ↗

The pointerenter event fires when a pointing device is moved into the hit test boundaries of an element or one of its descendants, including as a result of a pointerdown event from a device that does not support hover (see pointerdown). Otherwise, pointerenter works the same as mouseenter, and are dispatched at the same time. They are also dispatched at the same time as mouseover and pointerover events, if appropriate.

Syntax

Use the event name in methods like addEventListener(), or set an event handler property.

addEventListener("pointerenter", (event) => { })

onpointerenter = (event) => { }

Event type

A PointerEvent. Inherits from Event.

Examples

Using addEventListener():

const para = document.querySelector("p");

para.addEventListener("pointerenter", (event) => {
  console.log("Pointer entered element");
});

Using the onpointerenter event handler property:

const para = document.querySelector("p");

para.onpointerenter = (event) => {
  console.log("Pointer entered element");
};

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also