MouseEvent.pageY is a read-only number: the vertical pointer position in CSS pixels from the top edge of the entire document, including content scrolled out of view.
Read the notes below before you rely on this property. Prefer feature detection when support is limited.
Syntax
Use event.pageY. Start with this line.
JavaScript
event.pageY
Call
What it does
event.pageY
Primary signature.
Built into the browser. Read event.pageY on a MouseEvent — no import required.
Library declarations
JavaScript
event.pageY
Parameters
Parameter
Description
Mouse / pointer event
Required. Source of pageY
window.scrollY
Optional. Explains pageY ≈ clientY + scrollY
Return Value
Return Value
Description
*
The current value of event.pageY.
JavaScript Examples
Example 1 — Log pageX / pageY
Print document coordinates while you move (same pattern as MDN’s pageX demo).
JavaScript
const x = document.getElementById("x");
const y = document.getElementById("y");
function updateDisplay(event) {
x.textContent = event.pageX;
y.textContent = event.pageY;
}
document.addEventListener("mousemove", updateDisplay);
Listen on a box. The click still carries all three Y properties.
Document Y.pageY places the click on the full page.
Local Y.offsetY places the click inside the element.
Choose by job. Markers on a tall scrolled page → pageY; hit-test inside a control → offsetY.
Compatibility
Browser Support
MouseEvent.pageY is Baseline Widely available (MDN: since July 2015). It is not Deprecated, Experimental, or Non-standard.
✓ Baseline · Widely available
MouseEvent.pageY
Document-relative vertical pointer coordinate — includes vertical scroll for absolute page positions.
UniversalWidely available
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
pageYExcellent
Bottom line: Safe to use in modern browsers. Pair with pageX for document points; use clientY for viewport-only work and offsetY for element-local hits.
Frequently Asked Questions
It is a read-only number: the vertical mouse position in CSS pixels relative to the top edge of the entire document, including any part of the page that is scrolled out of view.
No. MDN marks MouseEvent.pageY as Baseline Widely available (since July 2015). It is not Deprecated, Experimental, or Non-standard.
pageY includes vertical scroll. If 200px of the top is scrolled away and you click 100px from the viewport’s top edge, pageY is about 300 — the same idea as pageX for the horizontal axis.
clientY is relative to the viewport and ignores document scroll. pageY is relative to the document and grows when you scroll down. Often: pageY ≈ clientY + window.scrollY.
offsetY is relative to the target element’s top padding edge. pageY is relative to the whole document. Use offsetY for clicks inside a box; use pageY for markers on a tall scrolled page.
A double floating-point value in pixels (MDN). Pair it with pageX for a full document point.