How to use DOM Object Close in JavaScript
In this article I am going to explain about DOM object close() method in JavaScript.
JavaScript DOM Object Close() Method
JavaScript Close() method use for close the out with current page and show output with document.open() method. Its will show results with new page.
Syntax
Example // In this example when you will click on button then a message will be on next page.
<html>
<head>
<script type="text/javascript">
function myfun() {
var mm = window.open();
mm.document.open();
mm.document.write("<h2>This is the new page</h2>");
mm.document.close();
}
</script>
</head>
<body style="background-color: Yellow">
<button onclick="myfun()">
clck me</button>
</body>
</html>
|
Output
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