Document: close() Methode

Die Document.close() Methode beendet das Schreiben in ein Dokument, das mit Document.open() geöffnet wurde.

Syntax

js
close()

Parameter

Keine.

Rückgabewert

Keiner (undefined).

Beispiele

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

Spezifikationen

Specification
HTML
# dom-document-close-dev

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
close

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
Has more compatibility info.