We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

Nos bénévoles n'ont pas encore traduit cet article en Français. Inscrivez-vous et aidez-nous à réaliser cette tâche !
Vous pouvez également lire cet article en English (US).

The touchstart event is fired when one or more touch points are placed on the touch surface.

General info

Specification
Touch Events
Interface
TouchEvent
Bubbles
Yes
Cancelable
Yes
Target
Document or Element
Default Action
undefined

Properties

Property Type Description
target Read only EventTarget The event target (the topmost target in the DOM tree).
type Read only DOMString The type of event.
bubbles Read only Boolean Whether the event normally bubbles or not.
cancelable Read only Boolean Whether the event is cancelable or not.
view Read only WindowProxy Document.defaultView, or the window the document resides in.
detail Read only long (float) Unused by touchstart events; always 0.
touches Read only TouchList A list of Touches for every point of contact currently touching the surface.
targetTouches Read only TouchList A list of Touches for every point of contact that is touching the surface and started on the element that is the target of the current event.
changedTouches Read only TouchList A list of Touches, one for each touch touch point that just became active with the current event.
ctrlKey Read only Boolean true if the control key was down when the event was fired. false otherwise.
shiftKey Read only Boolean true if the shift key was down when the event was fired. false otherwise.
altKey Read only Boolean true if the alt key was down when the event was fired. false otherwise.
metaKey Read only Boolean true if the meta key was down when the event was fired. false otherwise.

Examples

Code samples for those events are available on the dedicated page: Touch events.

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 22.0 (Yes) 18.0 (18.0)[1]
52.0 (52.0)[2]
No support No support No support
Feature Android Android Webview Chrome for Android Edge Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile
Basic support (Yes) (Yes) (Yes) (Yes) 6.0 (6.0) (Yes) 11 (Yes) (Yes)

[1] Touch events were implemented in Gecko 18.0, but removed again in 24.0 (Firefox 24.0 / Thunderbird 24.0 / SeaMonkey 2.21) on the desktop version of Firefox due to web compatibility issues (bug 888304).

[2] As of Gecko 52.0, touch events support has been fixed and reenabled in Windows desktop platforms.

Étiquettes et contributeurs liés au document

Dernière mise à jour par : Sheppy,