MouseEvent in DOM Level 2 Events

Provides contextual information associated with a specific Mouse event.

For more information see

Inherits from:

Instance Properties

name type description
altKey Boolean (read only) Was the 'alt' key depressed when this event was fired?
bubbles Boolean (read only) [from Event]
button Number (read only) Which mouse button was pressed?
cancelable Boolean (read only) [from Event]
clientX Number (read only)
clientY Number (read only)
ctrlKey Boolean (read only) Was the 'ctrl' key depressed when this event was fired?
currentTarget EventTarget (read only) The object to which the event handler was assigned. [from Event]
detail Number (read only) [from UIEvent]
eventPhase Number (read only) When/where did the event take place? [from Event]
metaKey Boolean (read only) Was the 'shift' key depressed when this event was fired?
relatedTarget EventTarget (read only) Element the mouse moved out of or over.
screenX Number (read only)
screenY Number (read only)
shiftKey Boolean (read only) Was the 'shift' key depressed when this event was fired?
target EventTarget (read only) The object which caught the event. [from Event]
timeStamp Number (read only) Date/time that the event occurred. [from Event]
type String (read only) [from Event]
view AbstractView (read only) [from UIEvent]

Instance Methods

name returns description
initEvent(eventTypeArg,canBubbleArg,cancelableArg) (none) Initialize the event object prior to dispatching it. [from Event]
initMouseEvent(typeArg,canBubbleArg,cancelableArg,…) (none)
initUIEvent(typeArg,canBubbleArg,cancelableArg,…) (none) [from UIEvent]
preventDefault() (none) [from Event]
stopPropagation() (none) [from Event]


The Mouse event module is composed of events listed in HTML 4.0 and additional events which are supported in DOM Level 0 browsers. This event module is specifically designed for use with mouse input devices. A DOM application may use the hasFeature(feature, version) method of the DOMImplementation interface with parameter values "MouseEvents" and "2.0" (respectively) to determine whether or not the Mouse event module is supported by the implementation. In order to fully support this module, an implementation must also support the "UIEvents" feature defined in this specification. Please, refer to additional information about conformance in the DOM Level 2 Core specification [DOM Level 2 Core]. Note: To create an instance of the MouseEvent interface, use the feature string "MouseEvents" as the value of the eventType parameter passed to createEvent(...). The detail attribute inherited from UIEvent indicates the number of times a mouse button has been pressed and released over the same screen location during a user action. The attribute value is 1 when the user begins this action and increments by 1 for each full sequence of pressing and releasing. If the user moves the mouse between the mousedown and mouseup the value will be set to 0, indicating that no click is occurring. In the case of nested elements mouse events are always targeted at the most deeply nested element. Ancestors of the targeted element may use bubbling to obtain notification of mouse events which occur within its descendent elements.