button property
Indicates which pointer device button has changed.
![]() ![]() |
Syntax
| JavaScript | |
|---|
Property values
Type: number
-
Mouse move with no buttons pressed(PointerEvent only)
-
- Left mouse button press, or
- Touch contact (PointerEvent only), or
- Pen contact (PointerEvent only)
-
Middle mouse button press
-
- Right mouse button press, or
- Pen contact with barrel button pressed (PointerEvent only)
-
X1 (back) mouse button press (PointerEvent only)
-
X2 (forward) mouse button press (PointerEvent only)
-
Pen contact with eraser button pressed (PointerEvent only)
Standards information
See also
Show:

