# MouseEvent : UIEvent
Return to: HTML DOM Level 2 index

Provides information for a Mouse-related event.

## Constructors

Constructor | Action | IE | Mozilla | Netscape | Opera | Safari
--- | --- | --- | --- | --- | --- | ---
MouseEvent Constructor() : MouseEvent Provides information for a Mouse-related event. | Show Details

### MouseEvent() : MouseEvent

Provides information for a Mouse-related event.

Returns

MouseEvent |

Visibility
  internal

## Inherited Properties

Property | Action | IE | Mozilla | Netscape | Opera | Safari
--- | --- | --- | --- | --- | --- | ---
detail : Number Numeric detail related to the event. | Show Details | no | 1.75+ | 7.0+ | no | 1.0+

- Mozilla: Incorrect on Windows.

  For examples, see the quirksmode test page:

  http://www.quirksmode.org/js/events/detail.html

Availability

  HTML DOM Level 2|W3C

view : AbstractView Window that generated the event. | Show Details | no | 1.0+ | 7.0+ | 7.0+ | 1.0+

Availability

  HTML DOM Level 2|W3C

## Properties

Property | Action | IE | Mozilla | Netscape | Opera | Safari
--- | --- | --- | --- | --- | --- | ---
altKey : Boolean If true, indicates that the user pressed the "Alt" key while the event occurred. | Show Details | 4.0+ | 1.0+ | 6.0+ | no | 1.0+

  For examples, see the quirksmode test page:

  http://www.quirksmode.org/js/events/keys.html

Availability

  HTML DOM Level 2|W3C

button : Number Specifies which mouse button was clicked or released during a mousedown, mouseup, or click event. | Show Details | 5.0+ | 1.75+ | 6.0+ | 8.0+ | 1.2+

- IE: Left button = "1". Right button = "2". Middle button = "4".
- Mozilla: Left button = "0". Right button = "1". Middle button = "2". On Mac, recognizies "shift+click" as a right-button click.
- Safari: Only detects the Left button click.
- Opera: Left button = "0". Right button = "1". Middle button = "2".

  For examples, see the quirksmode test page:

  http://www.quirksmode.org/js/events/button.html

Availability

  HTML DOM Level 2|W3C

clientX : Number Horizontal (x) coordinate of the mouse pointer in the window. | Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+

Availability

  HTML DOM Level 2|W3C

clientY : Number Vertical (y) coordinate of the mouse pointer in the window. | Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+

Availability

  HTML DOM Level 2|W3C

ctrlKey : Boolean If true, indicates that the user pressed the "Ctrl" key while the event occurred. | Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+

  For examples, see the quirksmode test page:

  http://www.quirksmode.org/js/events/keys.html

Availability

  HTML DOM Level 2|W3C

metaKey : Boolean If true, indicates that the user pressed the "Meta" key while the event occurred. | Show Details | no | 1.75+ | no | no | 1.0+

- Mozilla: Mac only.

  For examples, see the quirksmode test page:

  http://www.quirksmode.org/js/events/keys.html

Availability

  HTML DOM Level 2|W3C

relatedTarget : EventTarget Node related to the target node for the event. | Show Details | no | 1.0+ | no | 7.0+ | 1.0+

  For examples, see the quirksmode test page:

  http://www.quirksmode.org/js/events/targets.html

Availability

  HTML DOM Level 2|W3C

screenX : Number Horizontal (x) coordinate of the mouse pointer relative to the upper-left corner of the client screen. | Show Details | 5.0+ | 1.75+ | 6.0+ | 8.0+ | 1.2+

  For examples, see the quirksmode test page:

  http://www.quirksmode.org/js/events/mouseposition.html

Availability

  HTML DOM Level 2|W3C

screenY : Number Vertical (y) coordinate of the mouse pointer relative to the upper-left corner of the client screen. | Show Details | 5.0+ | 1.75+ | 6.0+ | 8.0+ | 1.2+

  For examples, see the quirksmode test page:

  http://www.quirksmode.org/js/events/mouseposition.html

Availability

  HTML DOM Level 2|W3C

shiftKey : Boolean If true, indicates that the user pressed the "Shift" key while the event occurred. | Show Details | 5.0+ | 1.75+ | 6.0+ | 8.0+ | 1.2+

  For examples, see the quirksmode test page:

  http://www.quirksmode.org/js/events/keys.html

Availability

  HTML DOM Level 2|W3C

## Inherited Functions

Method | Action | IE | Mozilla | Netscape | Opera | Safari
--- | --- | --- | --- | --- | --- | ---
initUIEvent(String typeArg, Boolean canBubbleArg, Boolean cancelableArg, AbstractView viewArg, Number detailArg) : void Sets the initial property values for a new UIEvent object. | Show Details | no | 1.0+ | 7.0+ | 7.0+ | 1.0+

Parameters

String | typeArg | Type of event.
Boolean | canBubbleArg | If true, the event should bubble by default.
Boolean | cancelableArg | If true, the event is cancellable by default.
AbstractView | viewArg | Window or frame for the event.
Number | detailArg | Code for the event detail.

Returns

void |

Availability

  HTML DOM Level 2|W3C

## Functions

Method | Action | IE | Mozilla | Netscape | Opera | Safari
--- | --- | --- | --- | --- | --- | ---
initMouseEvent() : void Sets the initial property values for a new MouseEvent object. | Show Details | no | 1.0+ | 6.0+ | 7.0+ | 1.0+

Returns

void |

Availability

  HTML DOM Level 2|W3C

## References

Event|UIEvent

## Availability

HTML DOM Level 2|W3C

text_javascript aptana_docs