<html> <head> <script language="JavaScript" type = "text/javascript"> <!-- document.onkeypress = DisplayMsg; function DisplayMsg() { window.alert("You just pressed a key."); } //--> </script> <title>Keyboard Event</title> </head> <body> </body> </html>