The TouchEvent touches property in HTML DOM is used to return the array of touch object. It returns one for each finger that is currently touching to the surface. The touches property is a read only property and it returns an array of touch objects.
Syntax:
event.touches
Return Value: It return the array of touch object.
Below program illustrates the TouchEvent touches property in HTML:
Example: This example find the number of fingers touch on the surface.
<!DOCTYPE html> <html> <head> <title> HTML DOM TouchEvent Touches Property </title> </head> <body ontouchstart = "touch(event)" ontouchend = "touch(event)"> <h1>GeeksforGeeks</h1> <h2>TouchEvent Touches Property</h2> <p>Number of fingers touching this document: <span id="test"></span>. <!-- script to colunt number of touch --> <script> function touch(event) { var t = event.touches.length; document.getElementById("test").innerHTML = t; } </script> </body> </html> |
Output:
Before touching the document:

After touching the document:

Supported Browsers: The browser supported by DOM TouchEvent touches Property are listed below:
- Internet Explorer 10.0
- Google Chrome 22.0
- Firefox 52.0
Recommended Posts:
- HTML | DOM TouchEvent metaKey Property
- HTML | DOM TouchEvent shiftKey Property
- HTML | DOM TouchEvent targetTouches Property
- HTML | DOM TouchEvent altKey Property
- HTML | DOM TouchEvent ctrlKey Property
- HTML | DOM TouchEvent
- Web TouchEvent API | TouchEvent.changedTouches
- HTML | DOM Map name Property
- HTML | DOM URL Property
- HTML | DOM dir Property
- HTML | DOM value Property
- HTML | DOM id Property
- HTML | DOM specified Property
- HTML | DOM Bdo dir Property
- HTML | DOM name Property
- HTML | DOM li value Property
- HTML | DOM lastElementChild Property
- HTML | DOM clientLeft Property
- HTML | DOM lastChild Property
- HTML | DOM scrollHeight Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


