JavaScript

Tuesday April 8, 2025
updated: April 10, 2002

 
Home
Getting Started
Lesson 1
Lesson 2
Lesson 3
Lesson 4
Lesson 5
Lesson 6
Lesson 7
Lesson 8
Resources
Credits

 

 


Lesson 5 Example: Window Object and its Properites

<SCRIPT> <!-- hide code from old browsers
NewWindow=window.open("","","width=200,height=200")
NewWindow.document.write("This is my new window!")
NewWindow.document.close()
//end hiding code -->
</SCRIPT>
    • First a new window is opened using the Window.open method
    • The size of the window is defined using the width and height attributes
    • Next the document which will be displayed in the window is created using the Document.write method.
    • Finally we must close the document

© 2002 Tracy Johnson