You are here: irt.org | FAQ | JavaScript | Window | Q222 [ previous next ]
A simple solution, but one which may not work on all browsers/platforms, is to us the onBlur event handler to regain the focus:
<body onBlur="self.focus()">
To do this correctly, you really need a modal dialogue window, supported in Internet Explorer, but not in Netscape Navigator. Danny Goodman provides a solution for both browsers which is described at: http://developer.netscape.com:80/viewsource/goodman_modal/goodman_modal.html.