Easy Tutorial
❮ Prop Attr Specified Met Win Focus ❯

HTML DOM write() Method


Definition and Usage

The write() method writes HTML expressions or JavaScript code to a document.

Syntax

Parameter Description
exp1, exp2, exp3, ... Optional. The output stream to be written. Multiple parameters can be listed, and they will be appended to the document in the order they appear.

Browser Support

All major browsers support the write() method.


Examples

Example 1

Writing some text to the output stream:

Example 2

Writing some formatted text to the output stream:

Example 3

Difference between write() and writeln():


❮ Prop Attr Specified Met Win Focus ❯