Template:MouseEventProperties

<tr>
  <td><code>currentTarget</code> <%- template("readonlyInline") %></td>
  <td>EventTarget</td>
  <td>The node that had the event listener attached.</td>
</tr>
<tr>
  <td><code>relatedTarget</code> <%- template("readonlyInline") %></td>
  <td>EventTarget</td>
  <td>For <code>mouseover</code>, <code>mouseout</code>, <code>mouseenter</code> and <code>mouseleave</code> events: the target of the complementary event (the <code>mouseleave</code> target in the case of a <code>mouseenter</code> event). <code>null</code> otherwise.</td>
</tr>
<tr>
  <td><code>screenX</code> <%- template("readonlyInline") %></td>
  <td>long</td>
  <td>The X coordinate of the mouse pointer in global (screen) coordinates.</td>
</tr>
<tr>
  <td><code>screenY</code> <%- template("readonlyInline") %></td>
  <td>long</td>
  <td>The Y coordinate of the mouse pointer in global (screen) coordinates.</td>
</tr>
<tr>
  <td><code>clientX</code> <%- template("readonlyInline") %></td>
  <td>long</td>
  <td>The X coordinate of the mouse pointer in local (DOM content) coordinates.</td>
</tr>
<tr>
  <td><code>clientY</code> <%- template("readonlyInline") %></td>
  <td>long</td>
  <td>The Y coordinate of the mouse pointer in local (DOM content) coordinates.</td>
</tr>
<tr>
  <td><code>button</code> <%- template("readonlyInline") %></td>
  <td>unsigned short</td>
  <td>The button number that was pressed when the mouse event was fired: Left button=0, middle button=1 (if present), right button=2. For mice configured for left handed use in which the button actions are reversed the values are instead read from right to left.</td>
</tr>
<% if ( !$0 ) { %>
  <tr>
    <td><code>buttons</code> <%- template("readonlyInline") %> </td>
    <td>unsigned short</td>
    <td>The buttons being pressed when the mouse event was fired: Left button=1, Right button=2, Middle (wheel) button=4, 4th button (typically, "Browser Back" button)=8, 5th button (typically, "Browser Forward" button)=16. If two or more buttons are pressed, returns the logical sum of the values. E.g., if Left button and Right button are pressed, returns 3 (=1 | 2). <a href="/en-US/docs/Web/API/MouseEvent">More info</a>.</td>
  </tr>
  <tr>
    <td><code>mozPressure</code> <%- template("readonlyInline") %> </td>
    <td>float</td>
    <td>The amount of pressure applied to a touch or tabdevice when generating the event; this value ranges between 0.0 (minimum pressure) and 1.0 (maximum pressure).</td> 
  </tr>
<% } %>
Search for pages that use Template:MouseEventProperties to see example use cases and how many pages use this macro.

Document Tags and Contributors

Tags: 
Last updated by: teoli,