Close Window Example

Press Escape or Enter to close this window.

For your convenience, I've placed the script on the How To page. Simply copy the code and paste it into the <BODY> section of an HTML topic.

This Script adds a Close button (right aligned) to where ever you inserted this script, and sets the focus to the close button. It also Closes the current window when Esc or Enter are pressed. The window can be HH or IE based. This script does not work in Netscape browsers.

If you click or highlight something in the page, the button loses its focus and the script stops responding.