English
<html> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <head> <script language="javascript"> var ie =navigator.appName=="Microsoft Internet Explorer" ?true:false; function keyDown(e) { if(!ie) { var nkey=e.which; var iekey='Now is ns browser'; var realkey=String.fromCharCode(e.which); } if( ie) { var iekey=event.keyCode; var nkey='Now is the ie browser'; var realkey=String.fromCharCode(event.keyCode); if(event.keyCode==32){realkey='' space ''} if(event.keyCode==13){realkey='' Enter''} if(event.keyCode==27){realkey='' Esc''} if(event.keyCode= =16){realkey='' Shift''} if(event.keyCode==17){realkey='' Ctrl''} if(event.keyCode==18){realkey='' Alt ''} } alert('The key value in ns browser:'+nkey+'n'+'The key value in ie browser:'+iekey+'n'+'The actual key is'+realkey); } document .onkeydown = keyDown; </script> </head> <body> //Javascript Document. <hr> <center> <h3>Please press any key. . . . </h3> </center> </body> </html>