you can use
event.button
to determine which mouse button was clicked.
Returns an integer value indicating the button that changed the state.
* 0 for standard 'click', usually left button
* 1 for middle button, usually wheel-click
* 2 for right button, usually right-click
Note that this convention is not followed in Internet Explorer: see
QuirksMode for details.
The order of the buttons may vary depending on how the pointing device is configured.
Also read
Which mouse button was clicked on?
: . , . , .