Easy Tutorial
❮ Prop Win Sessionstorage Jsref Anchor ❯

button Event Property


Definition and Usage

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

Syntax

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 parameters above are reversed.


More Examples

Popup which mouse button was clicked


❮ Prop Win Sessionstorage Jsref Anchor ❯