JavaScript Document createTouchList() Method

Beginner
⏱️ 11 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Deprecated
Non-standard
Instance method

What You’ll Learn

document.createTouchList() is a deprecated, non-standard instance method that once built a TouchList from zero or more Touch objects (see MDN Document: createTouchList()). Learn MDN’s empty / one / many examples, how it pairs with createTouch(), safe feature detection, and five try-it labs that still work when the API is missing.

01

Kind

Instance method

02

Returns

TouchList

03

Args

0..N Touches

04

Pairs with

createTouch()

05

Status

Deprecated

06

Also

Non-standard

Introduction

A TouchList is a list of active finger contacts — the kind of collection you normally read from touchstart / touchmove via event.touches or event.changedTouches.

Legacy engines also exposed document.createTouchList(...) so scripts could assemble those lists by hand (often after createTouch()). MDN now labels both helpers deprecated and non-standard.

💡
Legacy recipe (MDN)

1) Build Touch points with createTouch (if present)
2) Wrap them with createTouchList(touch1, touch2)
3) Modern apps: use real event TouchLists instead

Related tutorials: createTouch(), createEvent(), JavaScript hub.

Understanding document.createTouchList()

An instance method on Document that builds a TouchList from the Touch arguments you pass (MDN).

  • Purpose (legacy) — create a TouchList object (MDN).
  • Parameters — zero or more Touch objects (MDN).
  • Firefox note — MDN: Firefox also accepted an array of Touch objects.
  • Return value — a TouchList containing those touches (MDN).
  • Empty listcreateTouchList() with no args (MDN example).
  • Support reality — often removed; feature-detect every time.

📝 Syntax

General forms of Document.createTouchList (MDN):

JavaScript
createTouchList(touch1)
createTouchList(touch1, touch2)
createTouchList(touch1, touch2, /* …, */ touchN)

Parameters

  • touch1, …, touchN — zero or more Touch objects (MDN). Firefox also accepted an array of Touch objects (MDN).

Return value

A TouchList object containing the Touch objects specified (MDN).

Exceptions

None highlighted on MDN for the method itself. Calling a missing method throws TypeError — always feature-detect.

MDN example

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

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);

⚡ Quick Reference

GoalCode
Feature-detecttypeof document.createTouchList === "function"
Empty list (MDN)document.createTouchList()
One / manycreateTouchList(t1) / createTouchList(t1, t2)
Lengthlist.length
Item accesslist.item(0) or list[0]
MDN statusDeprecated & Non-standard

🔍 At a Glance

Four facts about document.createTouchList().

Returns
TouchList

object

Args
0..N Touch

MDN

Pairs
createTouch

legacy

Status
Deprecated

+ Non-standard

📋 When the API exists vs when it does not

Legacy engine with createTouchListModern browser (often removed)
typeof createTouchList"function""undefined"
MDN empty / one / manyMay build TouchListsThrows if called blindly
Needs createTouch?Often yes for full MDN sampleBoth usually missing together
Safe approachStill avoid in new productsFeature-detect + real events

Examples Gallery

Examples follow MDN Document: createTouchList() and safe feature-detection. On many desktops the method is missing — that is expected.

📚 Getting Started

Detect the legacy API before you call it.

Example 1 — Feature-detect createTouchList

Never assume the method exists on modern browsers.

JavaScript
const supported = typeof document.createTouchList === "function";
console.log(supported ? "createTouchList available (legacy)" : "createTouchList missing");

if (!supported) {
  console.log("Prefer event.touches / Pointer Events for real UI.");
}
Try It Yourself

How It Works

Checking typeof avoids a TypeError when Chromium-style engines removed the legacy factory.

Example 2 — MDN: empty, one, and two Touch lists

Guarded version of MDN’s createTouch + createTouchList sample.

JavaScript
const target = document.getElementById("target");
const hasList = typeof document.createTouchList === "function";
const hasTouch = typeof document.createTouch === "function";

if (!hasList || !hasTouch) {
  console.log("legacy touch factories not available");
} 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

MDN builds Touch points first, then wraps them. Empty createTouchList() yields length 0.

📈 Practical Patterns

Inspect lists safely and prefer real event data.

Example 3 — length and item() (when available)

Read entries from a created TouchList.

JavaScript
if (
  typeof document.createTouchList !== "function" ||
  typeof document.createTouch !== "function"
) {
  console.log("skipped — APIs missing");
} else {
  const t = document.createTouch(window, document.body, 9, 10, 20, 30, 40);
  const list = document.createTouchList(t);
  console.log(list.length);           // 1
  console.log(list.item(0).identifier); // 9
}
Try It Yourself

How It Works

TouchList exposes length and item(index) (array-like access is also common where supported).

Example 4 — Prefer a real event TouchList

Modern apps read lists from touch events, not Document factories.

JavaScript
console.log("createTouchList:", typeof document.createTouchList);

document.addEventListener("touchstart", (event) => {
  console.log("changedTouches.length:", event.changedTouches.length);
}, { once: true });

console.log("On desktop, try Pointer Events (pointerdown) instead.");
Try It Yourself

How It Works

Device-generated TouchLists are reliable for interaction. Synthesizing them with a removed Document method is not.

Example 5 — Detect both legacy factories together

MDN samples usually need both createTouch and createTouchList.

JavaScript
const touchOk = typeof document.createTouch === "function";
const listOk = typeof document.createTouchList === "function";

console.log("createTouch:", touchOk);
console.log("createTouchList:", listOk);
console.log(
  touchOk && listOk
    ? "legacy pair present (still avoid in new apps)"
    : "migrate — use real touch / pointer events"
);
Try It Yourself

How It Works

If either factory is missing, the classic MDN two-step recipe cannot run. Treat that as a migration signal, not a bug in your demo page.

🚀 Common Use Cases

  • Reading legacy samples — understand old synthetic touch tests.
  • Migrating old code — replace factories with real event lists.
  • Interview trivia — know it is deprecated and non-standard (MDN).
  • Not for new apps — use touch* events or Pointer Events.
  • Paired with createTouch — usually removed or kept together.
  • Not a mobile detector — never treat presence as “is phone”.

🧠 How createTouchList() Worked

1

Collect Touch objects

Often from legacy createTouch (MDN example).

Input
2

Pass 0..N touches

Empty call, one touch, or many touches (MDN).

Args
3

Get a TouchList

Legacy engines return a list you can read with length / item.

Create
4

Migrate away

Use real event.touches / Pointer Events in new products.

📝 Notes

  • MDN: Deprecated and Non-standard.
  • Not part of any current specification; not on track to become a standard (MDN).
  • Accepts zero or more Touch objects; Firefox also accepted an array (MDN).
  • Often used with createTouch() in legacy samples.
  • Feature-detect before calling — many modern engines omit it.
  • Related learning: createTouch(), createEvent(), JavaScript hub.

Limited / Legacy Browser Support

Document.createTouchList() is Deprecated and Non-standard on MDN. Logos use the shared browser-image-sprite.png sprite from this project. Many modern engines omit or removed this factory — do not ship new features that depend on it.

Deprecated · Non-standard

Document.createTouchList()

Legacy TouchList factory — missing in many current browsers. Prefer real event.touches / Pointer Events.

Legacy Not for new apps
Google Chrome Legacy createTouchList removed / omitted in modern versions
Avoid
Mozilla Firefox Legacy / restricted; do not depend on it for new code
Avoid
Apple Safari Treat as unavailable for new products
Avoid
Microsoft Edge Chromium Edge: treat as unavailable for new code
Avoid
Opera Follow Chromium legacy removal
Avoid
Internet Explorer No practical modern createTouchList path
Unavailable
createTouchList() Avoid

Bottom line: Feature-detect if you must read legacy code. For new work, use real touch event lists or Pointer Events — never rely on createTouchList().

Conclusion

document.createTouchList() was a legacy factory for TouchList objects. MDN marks it deprecated and non-standard. Feature-detect if you must read old samples that also use createTouch(), then migrate to real touch or pointer input for production UI.

Continue with createTouch(), createTreeWalker(), or the JavaScript hub.

💡 Best Practices

✅ Do

  • Treat this API as historical / migration knowledge
  • Feature-detect with typeof document.createTouchList === "function"
  • Read real event.touches / changedTouches in apps
  • Check createTouch too when following MDN’s full sample
  • Prefer Pointer Events when you need cross-input UI

❌ Don’t

  • Use createTouchList in new production code (MDN)
  • Call it without a feature check
  • Assume Chromium still ships this factory
  • Detect “mobile” by checking for createTouchList
  • Ignore the paired legacy createTouch dependency

Key Takeaways

Knowledge Unlocked

Five things to remember about createTouchList()

Legacy TouchList factory — deprecated and non-standard.

5
Core concepts
⚠️02

Status

Deprecated

MDN
🛡03

Also

Non-standard

MDN
💡04

Args

0..N Touch

MDN
🔎05

Safety

feature-detect

required

❓ 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.
Did you know?

MDN’s example creates an empty TouchList with document.createTouchList() — no arguments required. That empty list was useful in old tests, but today you should get TouchLists from real events instead of synthesizing them with a removed Document method.

Next: createTreeWalker()

Learn how to walk DOM subtrees with TreeWalker, whatToShow filters, and tree navigation.

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.

7 people found this page helpful