Element: touchstart event

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{APIRef("Touch Events")}}

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

Syntax

Use the event name in {{domxref("EventTarget/addEventListener", "addEventListener()")}}:

js-nolint
addEventListener("touchstart", (event) => { })

Alternatively, assign to the event handler property of the interface:

js-nolint
ontouchstart = (event) => { }

Event type

A {{domxref("TouchEvent")}}. Inherits from {{domxref("Event")}}.

{{InheritanceDiagram("TouchEvent")}}

Examples

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

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • Touch events