Window.ondevicemotion

An event handler for the devicemotion events sent to the window.

Syntax

window.ondevicemotion = funcRef;

Where funcRef is a reference to a function. This function receives a DeviceMotionEvent object describing the motion that occurred.

Specifications

Specification Status Comment
DeviceOrientation Event Specification Editor's Draft Initial definition.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
ondevicemotionChrome Full support 31Edge Full support 12Firefox Full support 9IE Full support 11Opera Full support 18Safari No support NoWebView Android Full support 4.4Chrome Android Full support 31Firefox Android Full support 9Opera Android Full support 18Safari iOS No support NoSamsung Internet Android Full support 2.0

Legend

Full support  
Full support
No support  
No support

See also