Event.button (Property)

The mouse button that was pressed to trigger the event in MSIE.


JScript - 3.0
Internet Explorer - 4.0
Property/method value type:Number primitive
JavaScript syntax:IEmyEvent.button

This property will contain a value to indicate the mouse button that was pressed to trigger the event.

Note that on a Macintosh, this value is meaningless as there is only one button on an Apple Macintosh mouse although you can retrofit a third party 2 or 3 button mouse.

Third party mice can be added to Apple Macintosh systems to provide multiple (2 or 3) button functionality, but they are by no means commonplace and it is probably safe to assume only a 1 button mouse on the Macintosh platform.

The values for the buttons are defined to cope with 1, 2 or 3 button mice.

The following values correspond with mouse buttons:

DOM level 2 event handling moves this property to the MouseEvent object.


See also:Event.which, MouseEvent.button, onClick, onDblClick, onMouseDown, onMouseUp

Property attributes: