Skip to content
Related Articles

Related Articles

HTML | DOM writeln() Method

View Discussion
Improve Article
Save Article
Like Article
  • Difficulty Level : Basic
  • Last Updated : 25 Jul, 2019

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
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!