Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <h1>DOM touchmove Event</h1> <p id="myP">Touch this paragraph and move the finger to trigger a function that will write "Hello World".</p> <p><strong>Note:</strong> This example is for touch devices only.</p> <p id="demo"></p> <script> document.getElementById("myP").addEventListener("touchmove", myFunction); function myFunction() { document.getElementById("demo").innerHTML = "Hello World"; } </script> </body> </html>