The window object is the top object in the DHTML Object Model, and
contains
information about the window and the frames.
Property |
Description |
clientInformation |
Returns a navigator object |
closed |
Returns a Boolean value that indicates whether the window is closed
or not |
complete |
Returns a Boolean value that indicates whether the window
is finished
loading or not |
dataTransfer |
Returns predefined clipboard formats that can be
used when transferring data |
defaultStatus |
Sets or returns the default message in the status bar |
dialogArguments |
Sets or returns the arguments in a dialog box created by
showModalDialog() or showModelessDialog() |
dialogHeight |
Sets or returns the height of a dialog box |
dialogLeft |
Sets or returns the left coordinate of a dialog box |
dialogTop |
Sets or returns the top coordinate of a dialog box |
dialogWidth |
Sets or returns the width of a dialog box |
document |
Returns the document object |
event |
Returns the event object |
external |
Returns the host of a Web page |
history |
Returns
previously visited URLs |
length |
Returns the number of frames in a window |
location |
Returns the
current URL |
name |
Sets or returns the name of the window |
navigator |
Returns a navigator object |
offscreenBuffering |
Indicates whether objects are offscreen before displayed |
opener |
Sets or returns the object that opened the current window |
parent |
Returns the parent object of the current frame |
returnValue |
Sets or returns the return value from a dialog box |
screen |
Returns an object that gives you information about the
user's screen |
screenLeft |
Returns the coordinates of the left edge of the client's
screen |
screenTop |
Returns the coordinates of the top edge of the client's
screen |
self |
Returns the current window object |
status |
Sets or returns the message in the status bar |
top |
Returns the topmost window object |
Method |
Description |
alert() |
Displays an alert box with a message and an OK button |
attachEvent() |
Attaches the function to an event. The function
will be called every time the event is fired |
blur() |
Window loses focus |
clearInterval() |
Clears the setInterval() method |
clearTimeout() |
Clears the setTimeout() method |
close() |
Closes the current window |
confirm() |
Displays a confirm box with a message, a Cancel and an OK
button |
detachEvent() |
Detaches a function from an event |
execScript() |
Enables you to execute a script |
focus() |
Sets focus on a specified window |
moveBy() |
Moves the window's position. From the current
position |
moveTo() |
Moves the window to a specified position |
navigate() |
Window navigates to a specified URL |
open() |
Opens a new window |
print() |
Prints the window's document |
prompt() |
Displays a prompt box with a message and an input field |
resizeBy() |
Resizes the window, by the specified x and y
offsets |
resizeTo() |
Resizes the window to a specified value |
scroll() |
This method is deprecated in JavaScript 1.2. It has been replaced by
scrollTo() |
scrollBy() |
Scrolls the window, from the current scroll position |
scrollTo() |
Scrolls the window to a specified position |
setInterval() |
An expression is valuated each time the specified
interval occurs |
setTimeout() |
An expression is valuated after the specified timeout has
occurred |
showHelp() |
Displays a specified help file |
showModalDialog() |
Displays a modal dialog box that shows a specified HTML
document |
showModelessDialog() |
Displays a modeless dialog box that shows a specified
HTML document |
W3Schools is for training only. We do not warrant its correctness or its fitness for use.
The risk of using it remains entirely with the user. While using this site, you agree to have read and accepted our
terms of use and
privacy policy.