Name
MouseEvent: details about a mouse event — DOM Level 2 Events: Event → UIEvent → MouseEvent
Properties
-
readonly boolean altKey Whether the Alt key was held down when the event occurred. Defined for all types of mouse events.
-
readonly unsigned short button Which mouse button changed state during a mousedown, mouseup, or click event. A value of 0 indicates the left button, a value of 2 indicates the right button, and a value of 1 indicates the middle mouse button. Note that this property is defined when a button changes state; it is not used to report whether a button is held down during a mousemove event, for example. Also, this property is not a bitmap: it cannot tell you if more than one button is held down.
-
readonly long clientX, clientY The X and Y coordinates of the mouse pointer relative to the client area, or browser window. Note that these coordinates do not take document scrolling into account; if an event occurs at the very top of the window,
clientYis 0 regardless of how far down the document has been scrolled. These properties are defined for all types of mouse events.-
readonly boolean ctrlKey Whether the Ctrl key was held down when the event occurred. Defined for all types of mouse events.
-
readonly boolean metaKey Whether the Meta key was held down when the event occurred. Defined for all types of mouse events.
-
readonly Node relatedTarget Refers to a document node that is related to the
targetnode of the event. For mouseover events, it is the node the mouse left ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access