--- title: Document.writeln() slug: Web/API/Document/writeln translation_of: Web/API/Document/writeln ---
{{ ApiRef("DOM") }}
Schreibt eine Textfolge, gefolgt von einem Zeilenumbruchzeichen, in ein Dokument.
document.writeln(line);
line
ist eine Zeichenfolge welche eine Textzeile enthält.document.writeln("<p>enter password:</p>");
document.writeln ist dasselbe wie {{domxref("document.write")}} aber fügt einen Zeilenumbruch hinzu.
NS_ERROR_DOM_NOT_SUPPORTED_ERR
) error on the error console). This is the case if opening a local file with a .xhtml file extension or for any document served with an application/xhtml+xml MIME type. More information is available in the W3C XHTML FAQ.Spezifikation | Status | Bemerkung |
---|---|---|
{{SpecName("HTML WHATWG", "#dom-document-writeln", "document.writeln()")}} | {{Spec2("HTML WHATWG")}} | |
{{SpecName("DOM2 HTML", "html.html#ID-35318390", "document.writeln()")}} | {{Spec2("DOM2 HTML")}} |
{{Compat("api.Document.writeln")}}