asp.net.ph

Skip Navigation Links

button Property

event Properties   DHTML Events


DOM Level 2 Specification.

Retrieves which mouse button, if any, is pressed.

Syntax


HTML N/A
Script [ sWhichButton = ] event.button

Possible Values


0 No button is pressed.
1 Left button is pressed.
2 Right button is pressed.
3 Both left and right buttons are pressed.
4 Middle button is pressed.
5 Both left and middle buttons are pressed.
6 Both right and middle buttons are pressed.
7 All three buttons are pressed.

The property is read-only with a default value of 0.

Remarks

During mouse events caused by the depression or release of a mouse button, button is used to indicate which mouse button changed state. For mice configured for left handed use in which the button actions are reversed, the values are instead read from right to left.

This property is intended to be used with the onmousedown, onmouseup, and onmousemove events. For other events, it defaults to 0 regardless of the state of the mouse buttons.

Applies To

event



>

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note