ontouchmove Event
Example
Execute a JavaScript when a finger is moved around in a <div> element:
<div ontouchmove="myFunction()">Drag your finger here!</div>
Try it Yourself »
Definition and Usage
The ontouchmove event occurs continuously while a finger is dragged across the screen, over an element.
Tip: Use the preventDefault() method to cancel default behaviors for the ontouchmove event, such as scrolling:
document.body.addEventListener("touchmove", function(event) {
event.preventDefault()
});
Browser Support
The numbers in the table specify the first browser version that fully supports the event.
For desktop computers with touch screen:
| Event | |||||
|---|---|---|---|---|---|
| ontouchmove | 22.0 | Not supported | Not supported | Not supported | 15.0 |
For mobile devices:
| iOS Safari | Android Browser | Chrome Android | Firefox Android | Android UC Browser | Blackberry Browser | IE Mobile | Opera Mini | Opera Mobile |
|---|---|---|---|---|---|---|---|---|
| 3.2 | 2.1 | 39.0 | 33.0 | 9.9 | 7.0 | No | No | 11.5 |
Syntax
In JavaScript, using the addEventListener() method:
object.addEventListener("touchmove", myScript);
Try it Yourself »
Note: The addEventListener() method is not supported in Internet Explorer 8 and earlier versions.
Technical Details
| Bubbles: | Yes |
|---|---|
| Cancelable: | Yes |
| Event type: | TouchEvent |
| Supported HTML tags: | All HTML elements, EXCEPT: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, and <title> |
❮ Event Object

