Document: thuộc tính all
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
Thuộc tính chỉ đọc all của giao diện Document trả về một HTMLAllCollection có gốc tại nút tài liệu.
Thay vì sử dụng document.all để trả về một HTMLAllCollection của tất cả các phần tử trong tài liệu theo thứ tự tài liệu, bạn có thể sử dụng Document.querySelectorAll để trả về một NodeList của tất cả các phần tử trong tài liệu theo thứ tự tài liệu:
const allElements = document.querySelectorAll("*");
Giá trị
Một HTMLAllCollection chứa mọi phần tử trong tài liệu.
Đặc tả kỹ thuật
| Specification |
|---|
| HTML> # dom-document-all> |