Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since December 2015.
The offsetX read-only property of the MouseEvent interface provides the offset in the X coordinate of the mouse pointer between that event and the padding edge of the target node.
A double floating point value in pixels.
Early versions of the spec defined this as an integer.
| CSSOM View Module # dom-mouseevent-offsetx |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Feb 13, 2026 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.