JavaScript Document createTouchList() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Method

Definition

document.createTouchList(touch1, …, touchN) was a legacy factory that creates a TouchList from zero or more Touch objects (MDN). It is Deprecated and Non-standard — literacy only. Old samples often paired it with createTouch().

Pass the required arguments shown below. Check return values and browser support before you rely on the result.

Syntax

Call document.createTouchList. Start with this line.

JavaScript
document.createTouchList(touch1, …, touchN)
CallWhat it does
document.createTouchList(touch1, …, touchN)Primary signature.
document.createTouchList(...)Call with the arguments your case needs.

Built into the browser. Call createTouchList(...) on document — no import required.

Library declarations
JavaScript
document.createTouchList(touch1, …, touchN)

Parameters

ParameterDescription
touch1 … touchNOptional. Zero or more Touch objects (MDN)

Return Value

Return ValueDescription
*A TouchList (when supported)

JavaScript Examples

Example 1 — Feature-Detect Both Factories

Chromium often removed both createTouch and createTouchList.

JavaScript
console.log(typeof document.createTouchList === "function");
console.log(typeof document.createTouch === "function");

if (typeof document.createTouchList !== "function") {
  console.log("Prefer event.touches / Pointer Events");
}
Try It Yourself

How It Works

  1. Detect the list factory before any call.
  2. Detect createTouch if MDN samples need Touch points first.
  3. Expect false in most Chromium browsers today.
  4. Branch cleanly so demos do not throw.

Example 2 — MDN Empty / One / Two Lists

Recognize this shape in old samples — only run when both factories exist.

JavaScript
const target = document.getElementById("target");

if (
  typeof document.createTouch !== "function" ||
  typeof document.createTouchList !== "function"
) {
  console.log("unsupported");
} else {
  const touch1 = document.createTouch(window, target, 1, 15, 20, 35, 40);
  const touch2 = document.createTouch(window, target, 2, 25, 30, 45, 50);

  const list0 = document.createTouchList();
  const list1 = document.createTouchList(touch1);
  const list2 = document.createTouchList(touch1, touch2);

  console.log(list0.length, list1.length, list2.length); // 0 1 2
}
Try It Yourself

How It Works

  1. Guard both APIs — MDN builds touches first, then lists.
  2. Empty call creates a list with length 0.
  3. One / two args wrap those Touch objects.
  4. Literacy only — do not ship this factory in new apps.

Example 3 — Prefer Real Event Touch Lists

Production code should read touches from the event, not synthesize them.

JavaScript
console.log("createTouchList deprecated — use event.touches (MDN literacy)");

window.addEventListener("touchstart", (e) => {
  console.log("touches length →", e.touches.length);
}, { passive: true });

window.addEventListener("pointerdown", (e) => {
  console.log(e.pointerType, e.clientX, e.clientY);
});
Try It Yourself

How It Works

  1. Skip the factory for new product code.
  2. Use e.touches (or changedTouches) from real touch events.
  3. Or use Pointer Events for mouse + touch in one model.
  4. Recognize createTouchList only in old tests or docs.

Browser Support

Document.createTouchList() is Deprecated and Non-standard on MDN. It is not part of any current specification. Chromium removed it; do not assume support.

✓ Deprecated · Non-standard

Document.createTouchList()

Legacy TouchList factory — literacy only. Prefer event.touches or Pointer Events.

Legacy Avoid in new code
Google Chrome Removed / unsupported
No
Microsoft Edge Removed / unsupported
No
Opera Removed / unsupported
No
Apple Safari Legacy / check
Partial
Mozilla Firefox Legacy / check
Partial
Internet Explorer No
No
createTouchList() Often unsupported

Bottom line: Feature-detect only for legacy demos. See the MDN createTouchList() reference.

Frequently Asked Questions

MDN: Document.createTouchList() creates and returns a new TouchList object containing zero or more Touch objects you pass in.
Yes. MDN marks Document.createTouchList() as Deprecated and Non-standard. It is not part of any current specification and is no longer on track to become a standard.
MDN: zero or more Touch objects (touch1 … touchN). Firefox also accepted an array of Touch objects.
Legacy samples often called createTouch() to build Touch points, then createTouchList() to wrap them. Both APIs are deprecated and non-standard.
Often no. Chromium removed legacy createTouch / createTouchList years ago. Always feature-detect typeof document.createTouchList === "function" before calling it.
For real interaction, listen to touch events (changedTouches / touches) or prefer Pointer Events. Avoid synthesizing TouchList with this legacy Document factory in new apps.

Next: createTreeWalker()

Learn how to walk a DOM subtree with a configurable TreeWalker.

createTreeWalker() →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

19 people found this page helpful