Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q632 Is is possible to trap the escape key and cause it to close the browser window?

irt.org | Knowledge Base | JavaScript | Window | Q632 [ previous next ]

Q632 Is is possible to trap the escape key and cause it to close the browser window?

Only in Internet Explorer 5b2 and possibly Internet Explorer 4:

<HEAD>
<SCRIPT LANGUAGE="JavaScript1.2"><!--
function microsoftKeyPress() {
    if (window.event.keyCode == 27)
        window.close();
}
//--></SCRIPT>

</HEAD>

<BODY onKeyPress="microsoftKeyPress()">
</BODY>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.