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

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

Functions

Method Action IE Mozilla Netscape Opera Safari
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