This page is In Progress

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

document.write

Summary

Method to insert a string of marked up text in the document tree.

Method of dom/Documentdom/Document

Syntax

 document.write(str);

Parameters

str

Data-type
String

A String that specifies the text and HTML tags to write.

Return Value

No return value

Usage

 Do not use the write method or the writeln method on the current document after the document has finished loading unless you first call the open method, which clears the current document window and erases all variables.

Notes

When Document.write or document.writeln is used in an event handler, you must also use document.close.

Related specifications

DOM HTML Level 2
W3C Recommendation

See also

Related pages

Attributions