Name

HTMLDocument.writeln( ) — append HTML text and a newline to an open document

Availability

DOM Level 1 HTML

Synopsis

void writeln(String text);

Arguments

text

The HTML text to be appended to the document.

Description

This method is like HTMLDocument.write( ), except that it follows the appended text with a newline character, which can be useful when writing the content of a <pre> tag, for example.

See Also

Document.writeln( ) in the client-side reference section

Get JavaScript: The Definitive Guide, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.