JavaScript MouseEvent screenY Property

Beginner
5 min read
Updated: Nov 2026
3 examples
Property

Definition

event.screenY is a read-only number: the vertical pointer position in screen coordinates (CSS pixels from the top of the screen) (MDN).

Read the notes below before you rely on this property. Prefer feature detection when support is limited.

Syntax

Use event.screenY. Start with this line.

JavaScript
event.screenY
CallWhat it does
event.screenYPrimary signature.

Built into the browser. Read event.screenY on a MouseEvent — no import required.

Library declarations
JavaScript
event.screenY

Parameters

This member has no parameters beyond those shown in the signature.

Return Value

Return ValueDescription
*double px (CSS pixels)

JavaScript Examples

Example 1 — Log screenY on Move

MDN-style: update a log whenever the pointer moves.

JavaScript
const log = document.getElementById("screen-log");

document.addEventListener("mousemove", (e) => {
  log.textContent = `screenY: ${e.screenY}`;
});
Try It Yourself

How It Works

  1. Listen for mousemove. Fires as the pointer moves.
  2. Read screenY. Vertical px from the screen top.
  3. Show it live. Useful for demos and debugging.
  4. Value type. A double in modern engines (MDN).

Example 2 — screenY vs clientY

Same pointer, two origins: screen vs viewport.

JavaScript
document.addEventListener("mousemove", (e) => {
  console.log("screenY:", e.screenY);
  console.log("clientY:", e.clientY);
  console.log("pageY:", e.pageY);
  // screenY usually differs from clientY unless the window is flush to the screen top
});
Try It Yourself

How It Works

  1. screenY. From the monitor’s top edge.
  2. clientY. From the viewport’s top edge.
  3. pageY. Document Y (adds scroll).
  4. Move the window. screenY changes relative to clientY.

Example 3 — Full Screen Point with screenX

Build { x, y } in screen space.

JavaScript
el.addEventListener("click", (e) => {
  const point = { x: e.screenX, y: e.screenY };
  console.log(point);
  // { x: 640, y: 360 }  (example values)
});
Try It Yourself

How It Works

  1. Read both axes. screenX + screenY.
  2. Store a point. Handy for logging or desktop-relative UI.
  3. Same event. Both values come from one MouseEvent.
  4. Not element-local. Use offsetY for drawing inside a canvas/box.

Browser Support

MouseEvent.screenY is marked Baseline Widely available on MDN (since July 2015).

✓ Baseline · Widely available

MouseEvent.screenY

Read-only vertical mouse position in screen (monitor) coordinates. Pair with screenX. Not Deprecated, Experimental, or Non-standard.

100% Widely available
Google Chrome Yes (Baseline)
Yes
Microsoft Edge Yes (Baseline)
Yes
Mozilla Firefox Yes (Baseline)
Yes
Apple Safari Yes (Baseline)
Yes
Opera Yes (Baseline)
Yes
Internet Explorer Supported (legacy)
Yes
screenY Excellent

Bottom line: Safe everyday DOM API. See the MDN screenY reference.

Frequently Asked Questions

It is a read-only number: the vertical mouse position in CSS pixels relative to the top edge of the user’s screen (monitor), not the browser window or the document.
No. MDN marks MouseEvent.screenY as Baseline Widely available (since July 2015). It is not Deprecated, Experimental, or Non-standard.
clientY is measured from the viewport’s top edge (the visible browser window). screenY is measured from the screen’s top edge. Moving or resizing the window changes how they relate.
pageY is relative to the document and includes vertical scroll. screenY ignores page scroll — it is screen-space vertical position.
They form a full screen point: { x: event.screenX, y: event.screenY }. screenX is horizontal from the screen’s left; screenY is vertical from the screen’s top.
A double floating-point value in pixels. Early specs defined it as an integer; modern engines expose a double for subpixel precision.

Next: shiftKey

Check whether the Shift key was pressed for the mouse event.

shiftKey tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

9 people found this page helpful