buttonEvent Property

事件对象参考手册Event Object

Definition and Usage

The button event property returns an integer indicating which mouse button was clicked when the event was triggered.

Syntax

event.button=0|1|2

Parameter Description
0 Specifies the left mouse button.
1 Specifies the middle mouse button.
2 Specifies the right mouse button.

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

Parameter Description
1 Specifies the left mouse button. (IE8 and earlier IE versions)
4 Specifies the middle mouse button. (IE8 and earlier IE versions)
2 Specifies the right mouse button.


Tips and Notes

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


实例

More Examples

Pop up which mouse button was clicked
Pop up which mouse button was clicked.


事件对象参考手册Event Object Other Extensions