function process(event) { var x = event.accelerationIncludingGravity.x; var y = event.accelerationIncludingGravity.y; var z = event.accelerationIncludingGravity.z; document.getElementById('log').innerHTML = "X : " + x + "
Y : " + y + "
Z : " + z; } window.addEventListener("devicemotion", process, true);