Microsoft Office Online
Sign in to My Office Online (What's this?) | Sign in

 
 
Microsoft Office FrontPage
Search
Search
 
Check for updates: (c) Microsoft
Office downloads
 
 
 
Warning: You are viewing this page with an unsupported Web browser. This Web site works best with Microsoft Internet Explorer 6.0 or later, Firefox 1.5, or Netscape Navigator 8.0 or later. Learn more about supported browsers.

Email this linkEmail this link Printer-Friendly VersionPrinter-Friendly Version Bookmark and ShareShare
Add a Close Window hyperlink to a Web page
 

The following shows you how to add a Close Window hyperlink by creating a code snippet that closes a browser window and then inserting the snippet into a page from the code snippets library.

ShowTo create a Close Window code snippet

  1. Copy the following text beginning with <a and ending with /a> by selecting it and then pressing CTRL+C.

    <a href="javascript:window.close();">Close Window</a>

  2. On the Tools menu, click Page Options, and then click the Code Snippets tab.
  3. Click Add.
  4. In the Keyword box, type closeWindow.
  5. In the Description box, type Close Window script.
  6. In the Text box, paste the text that you copied in step 1 by pressing CTRL+V.
  7. Click OK to close the Add Code Snippet dialog box, and then click OK again.

ShowTo insert a Close Window code snippet into a page

  1. In Page view, at the bottom of the document window, click Code Button image.
  2. Place the insertion point where you want to insert the code snippet.
  3. Press CTRL+ENTER.
  4. Select Close Window script from the list and press ENTER.
advertisement