Hi,

So I fixed the problem by specifying...

document.onkeydown = handleKeyPress;

...rather than inline in the bodytag as before...and now IE and
Firefox both work and both validate.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd";>
<html  lang="en-US">
        <head>
                <title>
                        Keypress testing 14.
                </title>
                <meta http-equiv="Content-Type" 
content="text/html;charset=utf-8" >
                
                <script type="text/javascript"  >
                        function handleKeyPress(evt) {
                                alert("Key pressed!")
                        }       
                        document.onkeydown = handleKeyPress;
                </script>

        </head>
        
        <body >
                <p>Press a key!</p>
        </body>
</html>

Cheers,

Simon


*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to