document.writeln()

JavaScript 1.0+, JScript 1.0+ Nav2+, IE 3+, Opera3+ Syntax

document.writeln(value,….)

Description

The writeln() method appends the comma-separated argument(s) ( value ) to the document as a string. Unlike the write() method, the writeln() method appends a newline character to the document after the last argument has been written. If any of the arguments are not strings, they are converted to strings before being appended to the document.

Example

Listing 7.200 writes some text, as well as the value of a property, to the current document using the writeln() method. The <pre> tag is used to make the newline character, which was created by the writeln() method, appear in the Web page.

Listing 7.200 Displaying Text on ...

Get Pure JavaScript 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.