HTMLElement: pointerenter event

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).

Bubbles No
Cancelable No
Interface PointerEvent
Event handler property onpointerenter


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');


Pointer Events
# the-pointerenter-event

Browser compatibility

BCD tables only load in the browser

See also