Document: pointerdown event
The pointerdown
event is fired when a pointer becomes active. For mouse, it is fired when the device transitions from no buttons depressed to at least one button depressed. For touch, it is fired when physical contact is made with the digitizer. For pen, it is fired when the stylus makes physical contact with the digitizer.
Bubbles | Yes |
---|---|
Cancelable | Yes |
Interface | PointerEvent |
Event handler property | onpointerdown |
Examples
Using addEventListener()
:
document.addEventListener('pointerdown', (event) => {
console.log('Pointer down event');
});
Using the onpointerdown
event handler property:
document.onpointerdown = (event) => {
console.log('Pointer down event');
};
Specifications
Specification |
---|
Pointer Events # the-pointerdown-event |
Browser compatibility
BCD tables only load in the browser
See also
onpointerdown
event handler property.- This event on
HTMLElement
targets:pointerdown
event