MouseEvent.offsetX

You’re reading the English version of this content since no translation exists yet for this locale. Help us translate this article!

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

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. 

Syntax

var xOffset = instanceOfMouseEvent.offsetX;

Return value

A double floating point value. Early versions of the spec defined this as an integer. See the Browser compatibility section for details.

Specifications

Specification Status Comment
CSS Object Model (CSSOM) View Module
The definition of 'MouseEvent' in that specification.
Working Draft Initial definition

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
offsetX
Experimental
Chrome Full support YesEdge Full support 12Firefox Full support 39IE Full support 6Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support 43Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
Value type changed from long to doubleChrome Full support 56Edge ? Firefox ? IE ? Opera ? Safari ? WebView Android Full support 56Chrome Android Full support 56Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.

See also