How to use DOM Object Close in JavaScript

In this article I am going to explain about DOM object close() method in JavaScript.
  • 1779

JavaScript DOM Object Close() Method

JavaScript Close() method use for close the out with current page and show output with method. Its will show results with new page.



Example // In this example when you will click on button then a message will be on next page.



    <script type="text/javascript">

        function myfun() {

            var mm =;


            mm.document.write("<h2>This is the new page</h2>");





<body style="background-color: Yellow">

    <button onclick="myfun()">

        clck me</button>






Before button click




After button click




You may also want to read these related articles: here
Ask Your Question 
Got a programming related question? You may want to post your question here


More Articles

© 2020 DotNetHeaven. All rights reserved.