English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML DOM writeln() Method

HTML DOM Document Object

saidwriteln()This method writes a sequence of text to the document and follows it with a newline character.

Note: document.writeln() vsdocument.write()Same, but with an added newline character.

Syntax:

document.writeln(line)
document.writeln("Hello World!");
document.writeln("Welcome to oldtoolbag.com");
Test See‹/›

Browser Compatibility

All browsers fully support the writeln() method:

Method
writeln()IsIsIsIsIs

Parameter Value

ParameterDescription
lineA string containing a line of text to be written to the document

Technical Details

Return Value:None
DOM Version:DOM 2Level

Related References

DOM Document open()Methods

DOM Document write()Methods

DOM Document close()Methods

HTML DOM Document Object