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

Save as Private