MouseEvent.screenX is a read-only number: the horizontal pointer position in CSS pixels from the left edge of the screen (monitor), not the browser window or the document.
Read the notes below before you rely on this property. Prefer feature detection when support is limited.
Syntax
Use event.screenX. Start with this line.
JavaScript
event.screenX
Call
What it does
event.screenX
Primary signature.
Built into the browser. Read event.screenX on a MouseEvent — no import required.
Library declarations
JavaScript
event.screenX
Parameters
Parameter
Description
Mouse / pointer event
Required. Source of screenX
Return Value
Return Value
Description
*
The current value of event.screenX.
JavaScript Examples
Example 1 — Log screenX / screenY
Print screen coordinates while you move (MDN-style demo).
Bottom line: Safe to use in modern browsers. Pair with screenY for screen points; use clientX / pageX for viewport and document work.
Frequently Asked Questions
It is a read-only number: the horizontal mouse position in CSS pixels relative to the left edge of the user’s screen (monitor), not the browser window or the document.
No. MDN marks MouseEvent.screenX as Baseline Widely available (since July 2015). It is not Deprecated, Experimental, or Non-standard.
clientX is measured from the viewport’s left edge (the visible browser window). screenX is measured from the screen’s left edge. Moving or resizing the window changes how they relate.
pageX is relative to the document and includes horizontal scroll. screenX ignores page scroll — it is screen-space.
MDN: in a multiscreen environment, screens aligned horizontally are treated as one device, so screenX can grow across the combined width of those screens.
A double floating-point value in pixels (MDN). Early specs defined it as an integer; modern engines expose a double. Pair with screenY for a full screen point.