button property (Internet Explorer)

Switch View :
ScriptFree
button property

Sets or retrieves the mouse button pressed by the user.

This property is not supported for Metro style apps using JavaScript.

Syntax

JavaScript

p = object.button

Property values

Type: Integer

0

Default. No button is pressed.

1

Left button is pressed.

2

Right button is pressed.

3

Left and right buttons are both pressed.

4

Middle button is pressed.

5

Left and middle buttons both are pressed.

6

Right and middle buttons are both pressed.

7

All three buttons are pressed.

Remarks

The property is read-only in Microsoft Internet Explorer 4.0, and read/write in Microsoft Internet Explorer 5 and later.

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

 

 

Send comments about this topic to Microsoft

Build date: 3/14/2012

Community Content

Mr. Raymond Kenneth Petry
Caution
Setting the value of event.button causes the onmouseup handler to quit from its middle.