MouseEvent.screenY is a read-only number: the mouse’s vertical position relative to the screen (monitor), not the page or the viewport. Learn how it differs from clientY and pageY, and practice with five try-it labs.
01
Kind
Instance property
02
Returns
Number (CSS px)
03
Status
Baseline Widely available
04
Origin
Screen top edge
05
Pair with
screenX
06
Scroll
Does not affect screenY
Fundamentals
Introduction
Sometimes you care about where the pointer sits on the physical display—not where it is inside the scrolled page or the browser chrome. That is screenX (horizontal) and screenY (vertical): coordinates in screen space.
JavaScript
document.addEventListener("mousemove", (event) => {
console.log(event.screenY); // pixels from screen top
});
💡
Beginner tip
Move the browser window up or down on your monitor: clientY stays tied to the window, while screenY tracks the pointer across the whole display.
Concept
Understanding the Property
MDN: screenY provides the vertical coordinate (offset) of the mouse pointer in screen coordinates. Pair it with screenX for a full screen point.
Instance — read event.screenY in a handler.
Number — CSS pixels; a floating-point double.
Screen-relative — independent of page scroll.
Read-only — set via constructor options on synthetic events only.
Foundation
📝 Syntax
JavaScript
const y = mouseEvent.screenY;
Value
A double floating-point value in pixels (MDN). Early versions of the specification defined this as an integer; modern engines expose a double for subpixel precision.
Mental model: use screenY for display-relative work, clientY for viewport UI, and pageY for document markers. Pair screenY with screenX for a full screen point.
Cheat Sheet
⚡ Quick Reference
Goal
Code
Read screen Y
event.screenY
Screen point
{ x: event.screenX, y: event.screenY }
Compare systems
screenY / clientY / pageY
Approx window top
screenY - clientY
MDN status
Baseline Widely available (Jul 2015)
Snapshot
🔍 At a Glance
Four facts about screenY.
Kind
instance
On the event
Type
double
CSS pixels
Origin
screen
Top edge = 0
Status
baseline
Widely available
Hands-On
Examples Gallery
Examples follow MDN MouseEvent.screenY. Move the mouse and (if you can) drag the browser window vertically to see screen vs viewport values.
📚 Getting Started
Read screenX / screenY from live pointer events.
Example 1 — Log Screen and Client Coordinates
MDN-style demo: show screen and client positions on mousemove.
With scrollY === 0, pageY and clientY often match, while screenY is usually larger because it includes the window’s offset on the monitor.
Example 5 — Estimate Window Top with screenY - clientY
Rough teaching math: screen minus viewport hints at the window’s top offset.
JavaScript
document.addEventListener("mousemove", (e) => {
// Approximate: how far the viewport is from the screen's top
const approxWindowTop = e.screenY - e.clientY;
console.log(approxWindowTop);
});
Dragging the window up or down changes screenY - clientY while keeping clientY stable for the same point inside the page. Real apps rarely need this; it is a clear way to feel the difference between the two systems.
Applications
🚀 Common Use Cases
Debugging pointer position relative to the physical display.
Teaching screen vs viewport vs document coordinate systems.
Building a full screen point with screenX + screenY.
Synthetic events in tests with known screenX / screenY.
Understanding how window chrome offsets relate to screen space.
Under the Hood
🔧 How It Works
1
Pointer moves on the display
The OS knows the cursor position in screen pixels.
Input
2
Browser keeps screen coordinates
Also maps to viewport and document for clientY / pageY.
Mapping
3
MouseEvent stores screenY
Your listener reads the vertical screen coordinate.
Event
4
✓
Use screen coordinates
Compare with clientY / pageY when teaching or debugging.
Important
📝 Notes
Baseline Widely available (MDN, since July 2015).
Not Deprecated, Experimental, or Non-standard — no status banner required.
Value type is a floating-point double in modern engines.
Page scroll does not change screenY; window position on the monitor does.
MouseEvent.screenY is Baseline Widely available across modern browsers (MDN: since July 2015). Logos use the shared browser-image-sprite.png sprite from this project.
✓ Baseline · Widely available
MouseEvent.screenY
Reliable screen-relative Y for monitor-space pointer positions.
UniversalWidely available
Google ChromeFull support · Desktop & Mobile
Full support
Mozilla FirefoxFull support · Desktop & Mobile
Full support
Apple SafariFull support · macOS & iOS
Full support
Microsoft EdgeFull support · Chromium
Full support
OperaFull support · Modern versions
Full support
Internet ExplorerSupported in modern IE versions
Full support
screenYExcellent
Bottom line: Read event.screenY for monitor-space vertical position; pair with screenX for a full screen point.
Wrap Up
Conclusion
event.screenY gives you the vertical mouse position relative to the screen. Use it when you need display space; reach for clientY for viewport UI and pageY for document markers.
Place absolute page markers with screen coordinates
Assume it equals offsetY inside an element
Mutate event.screenY on live user events
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about screenY
Screen-relative Y that ignores page scroll.
5
Core concepts
🖱️01
Instance
on the event
Kind
🔢02
Double
CSS pixels
Type
🖥️03
Screen
top edge origin
Origin
📈04
Scroll-free
ignores page scroll
Behavior
🛡️05
Baseline
widely available
Status
❓ 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, so no status warning banner is needed.
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 number of pixels. Early specs defined it as an integer; modern engines expose a double for subpixel precision.
Did you know?
Like screenX, early specs treated screenY as an integer pixel count. Modern engines expose a floating-point double, so you may see fractional values when subpixel positioning is involved—still a JavaScript Number either way.