MouseEvent which Property
Find out which mouse button that was pressed when a mouse event was triggered:
Definition and Usage
The which property returns a number that indicates which mouse button was pressed when a mouse event was triggered.
This property is mostly used together with the onmousedown event.
Note: The values returned by this property are the same as those returned by the button property plus one.
Note: This property is read-only.
The numbers in the table specify the first browser version that fully supports the property.
A Number, representing which mouse button that was pressed when the mouse event occured.
|DOM Version:||DOM Level 2 Events|
HTML DOM reference: MouseEvent button Property
HTML DOM reference: MouseEvent buttons Property
❮ Event Object