<!DOCTYPE html>
<html lang="en-US">
<body>
<h2>Swipe me slowly</h2>
<p id="point"></p>
<script>
var x = document.getElementsByTagName("h2")[0];
function myFunction(){
var xCoords = event.touches[0].clientX;
var yCoords = event.touches[0].clientY;
document.getElementById("point").innerHTML="("+xCoords+", "+xCoords")";
}
x.ontouchmove = myFunction;
</script>
<p><strong>Note</strong>: This example is only for touch devices.</p> </body>
</html>