button event properties


button Event attribute

Definition and usage


button The event attribute returns an integer indicating when the event is triggered Which mouse button was clicked.

Syntax

event.button=0|1|2

##ParametersDescription0Specifies the left mouse button. 1Specify the middle mouse button. 2Specify the right mouse button.

Note: Internet Explorer 8 and earlier IE versions have different parameters:

ParameterDescription1Specifies the left mouse button. (IE8 and earlier IE versions)4Specify the middle mouse button. (IE8 and earlier IE versions)2Specify the right mouse button.


Tips and Notes

Note: For left-handed mouse configurations, the parameters above are reversed of.



More examples

Pop up which mouse button was clicked

Pop up which mouse button was clicked.