MouseEvent : UIEvent

Provides information for a Mouse-related event.

Constructors

ConstructorIEMozillaNetscapeOperaSafariNetscapte
Provides information for a Mouse-related event.
 

Properties

PropertyIEMozillaNetscapeOperaSafariNetscapte
If true, indicates that the user pressed the "Alt" key while the event occurred.
4.0+1.0+6.0+no1.0+no
 
Specifies which mouse button was clicked or released during a mousedown, mouseup, or click event.
5.0+1.75+6.0+8.0+1.2+no
  • 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".
Horizontal (x) coordinate of the mouse pointer in the window.
4.0+1.0+6.0+7.0+1.0+no
 
Vertical (y) coordinate of the mouse pointer in the window.
4.0+1.0+6.0+7.0+1.0+no
 
If true, indicates that the user pressed the "Ctrl" key while the event occurred.
4.0+1.0+6.0+7.0+1.0+no
 
If true, indicates that the user pressed the "Meta" key while the event occurred.
no1.75+nono1.0+no
  • Mozilla: Mac only.
Node related to the target node for the event.
no1.0+no7.0+1.0+no
 
Horizontal (x) coordinate of the mouse pointer relative to the upper-left corner of the client screen.
5.0+1.75+6.0+8.0+1.2+no
 
Vertical (y) coordinate of the mouse pointer relative to the upper-left corner of the client screen.
5.0+1.75+6.0+8.0+1.2+no
 
If true, indicates that the user pressed the "Shift" key while the event occurred.
5.0+1.75+6.0+8.0+1.2+no
 

Methods

MethodIEMozillaNetscapeOperaSafariNetscapte
Sets the initial property values for a new MouseEvent object.
no1.0+6.0+7.0+1.0+no
 

References

Event | UIEvent

Availability

HTML DOM Level 2 | W3C

Constructor Detail

MouseEvent MouseEvent()

Provides information for a Mouse-related event.

Visibility
internal

Property Detail

Boolean altKey - read only

If true, indicates that the user pressed the "Alt" key while the event occurred.

For examples, see the quirksmode test page:

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

Availability

HTML DOM Level 2 | W3C

Number button - read only

Specifies which mouse button was clicked or released during a mousedown, mouseup, or click event.

For examples, see the quirksmode test page:

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

Availability

HTML DOM Level 2 | W3C

Number clientX - read only

Horizontal (x) coordinate of the mouse pointer in the window.

Availability

HTML DOM Level 2 | W3C

Number clientY - read only

Vertical (y) coordinate of the mouse pointer in the window.

Availability

HTML DOM Level 2 | W3C

Boolean ctrlKey - read only

If true, indicates that the user pressed the "Ctrl" key while the event occurred.

For examples, see the quirksmode test page:

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

Availability

HTML DOM Level 2 | W3C

Boolean metaKey - read only

If true, indicates that the user pressed the "Meta" key while the event occurred.

For examples, see the quirksmode test page:

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

Availability

HTML DOM Level 2 | W3C

EventTarget relatedTarget - read only

Node related to the target node for the event.

For examples, see the quirksmode test page:

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

Availability

HTML DOM Level 2 | W3C

Number screenX - read only

Horizontal (x) coordinate of the mouse pointer relative to the upper-left corner of the client screen.

For examples, see the quirksmode test page:

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

Availability

HTML DOM Level 2 | W3C

Number screenY - read only

Vertical (y) coordinate of the mouse pointer relative to the upper-left corner of the client screen.

For examples, see the quirksmode test page:

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

Availability

HTML DOM Level 2 | W3C

Boolean shiftKey - read only

If true, indicates that the user pressed the "Shift" key while the event occurred.

For examples, see the quirksmode test page:

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

Availability

HTML DOM Level 2 | W3C

Method Detail

initMouseEvent() : void

Sets the initial property values for a new MouseEvent object.

Availability

HTML DOM Level 2 | W3C