document.write()

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

document.write(value,….)

Description

The write() method appends the comma-separated argument(s) ( value ) to the document as a string. If any of the arguments are not strings, they are converted to strings before being appended to the document.

Example

Listing 7.199 writes some text, as well as the value of a property, to the current document using the write() method.

Listing 7.199 Displaying Text in a Document Using the write() Method
 <html> <head><title>Movies</title></head> <script language="JavaScript"> <!-- Hide //write data to the current document. document.write("The title of this web page is called <u>"); document.write(document.title,"</u>"); //Hide ...

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.