Web/API/MouseEvent/offsetX

From Get docs

This is an experimental technologyCheck 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 ModuleThe definition of 'MouseEvent' in that specification. Working Draft Initial definition

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet

offsetX

Experimental'

Chrome

Full support Yes

Edge

Full support 12

Firefox

Full support 39

IE

Full support 9

Opera

Full support Yes

Safari

Full support Yes

WebView Android

Full support Yes

Chrome Android

Full support Yes

Firefox Android

Full support 43

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support Yes

Value type changed from long to double Chrome

Full support 56

Edge

Full support ≤79

Firefox

?

IE

?

Opera

?

Safari

?

WebView Android

Full support 56

Chrome Android

Full support 56

Firefox Android

?

Opera Android

?

Safari iOS

?

Samsung Internet Android

Full support 6.0

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