close Method

DHTML, HTML, & CSS

 
Click to return to the DHTML, HTML & CSS home page    
cloneNode Method     close Method     DHTML Methods    

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:
Version data is listed when the mouse hovers over a link, or the link has focus.

window


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.