Document: all property

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

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

{{APIRef("DOM")}}

The {{DOMxRef("Document")}} interface's read-only **all** property returns an {{DOMxRef("HTMLAllCollection")}} rooted at the document node.

Rather than using document.all to return an {{DOMxRef("HTMLAllCollection")}} of all the document's elements in document order, you can use {{DOMxRef("Document.querySelectorAll")}} to return a {{DOMxRef("NodeList")}} of all the document's elements in document order:

js
const allElements = document.querySelectorAll("*");

Value

An {{DOMxRef("HTMLAllCollection")}} which contains every element in the document.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}