Document: phương thức close()

Phương thức Document.close() hoàn tất việc ghi vào một tài liệu, được mở bằng Document.open().

Cú pháp

js
close()

Tham số

Không có.

Giá trị trả về

Không có (undefined).

Ví dụ

js
// Open a document to write to it
document.open();

// Write the content of the document
document.write("<p>The one and only content.</p>");

// Close the document
document.close();

Đặc tả kỹ thuật

Specification
HTML
# dom-document-close-dev

Tương thích trình duyệt