1 out of 4 rated this helpful Rate this topic

button Property

.NET Framework 3.0

Gets or sets the mouse button pressed by the user.

Syntax

[ iWhichButton = ] object.button

Possible Values

iWhichButton Integer that specifies or receives one of the following values.
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.

The property is read/write. The property has a default value of 0.

DHTML expressions can be used in place of the preceding value(s). As of Internet Explorer 8, expressions are supported in IE7 Standards mode and IE5 (Quirks) mode only. For more information, see About Dynamic Properties and Defining Document Compatibility.

Remarks

The property is read-only in Microsoft Internet Explorer 4.0, and read/write in 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.

Standards Information

There is no public standard that applies to this property.

Applies To

event, Event Constructor
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Caution
Setting the value of event.button causes the onmouseup handler to quit from its middle.