Skip to content
Related Articles
Open in App
Not now

Related Articles

HTML | DOM writeln() Method

Improve Article
Save Article
  • Difficulty Level : Basic
  • Last Updated : 13 Jul, 2022
Improve Article
Save Article

The writeln() method is used to write a document with additional property of newline character after each statement. This method is similar to the document.write() method. 


document.writeln( exp1, exp2, exp3, ... )

Parameters: This method contain many parameters which is optional. All the expression arguments (exp1, exp2, …) can be listed and display with the order of occurrence. 



<!DOCTYPE html>
        <title>DOM writeln() Method</title>
            h1 {
            body {
        <h2>DOM writeln() Method</h2>
            document.write("Hello World!");
            document.write("Have a nice day!");
            document.writeln("Hello World!");
            document.writeln("Have a nice day!");



Supported Browsers: The browser supported by writeln() method are listed below:

  • Chrome 64
  • Edge 12
  • Internet Explorer 4
  • Firefox 1
  • Opera 51
  • Safari 11

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!