Javascript examples for DOM:Document write
Document write() Method - Open a new window called "MsgWindow", and write some text into it:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <script> function myFunction() {/*from w ww . j a v a 2 s .c o m*/ var myWindow = window.open("", "MsgWindow", "width=200,height=100"); myWindow.document.write("<p>This is 'MsgWindow'. I am 200px wide and 100px tall!</p>"); } </script> </body> </html>