Web APIs
PointerEvent.pointerType
String describing the pointer device type, such as mouse, pen or touch, or empty if unknown.
Formal Syntax & Structure
javascript syntaxjavascript
event.pointerTypeReturn Value
string
Pointer device category.
Working Example
Example Snippetjavascript
const e=new PointerEvent("pointerdown",{pointerType:"pen",pointerId:8});console.log(e.pointerType,e.pointerId);