myMouseEvent.button in DOM Level 2 Events
Which mouse button was pressed?
This property is read-only.
- Property Type
- Number
During mouse events caused by the depression or release of a mouse button, button
is used to indicate which mouse button changed state. The values for button
range from 0
to indicate the left button of the mouse, 1
to indicate the middle button if present, and 2
to indicate the right button.
For mice configured for left handed use in which the button actions are reversed the values are instead read from right to left.