Click to return to the DHTML, HTML     
cloneNode Method     close Method     DHTML Methods    
Web Workshop  |  DHTML, HTML & CSS

close Method


Closes the current browser window or HTML Application (HTA).

Syntax

window.close()

Return Value

No return value.

Remarks

The way that you close a window programmatically determines whether the user gets prompted. If you invoke the close method on a window that you did not open with script, the user sees a confirm dialog box. This also happens if you use close to exit the last running instance of Microsoft® Internet Explorer. You can only use the close method silently with HTAs. In the case of HTAs, the application is trusted and follows a different security model.

When a function fired by an event on the BODY object calls the close method, the window.close method is implied. When an event on the BODY object calls the close method, the document.close method is implied.

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:

window



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.