how to get keyCode, which, charCode property with jquery

 <html>  
 <head>  
 <title>charCode/keyCode/which example</title>  
 <script type="text/javascript">  
 function showKeyPress(evt)  
 {  
 alert("onkeypress handler: \n"  
 + "keyCode property: " + evt.keyCode + "\n"  
 + "which property: " + evt.which + "\n"  
 + "charCode property: " + evt.charCode + "\n"  
 + "Character Key Pressed: "  
 + String.fromCharCode(evt.charCode) + "\n"  
 );  
 }  
 function keyDown(evt)  
 {  
 alert("onkeydown handler: \n"  
 + "keyCode property: " + evt.keyCode + "\n"  
 + "which property: " + evt.which + "\n"  
 );  
 }  
 </script>  
 </head>  
 <body  
 onkeypress="showKeyPress(event);"  
 onkeydown="keyDown(event);"  
 >  
 <p>Please press any key.</p>  
 </body>  
 </html> 


Demo

Comments

Popular posts from this blog

Data Flow Diagram (DFD)

flexigrid + php with add and edit button

VERIFIKASI SUARA MENGGUNAKAN METODE MFCC DAN DTW MENGGUNAKAN METODE MFCC DAN DTW (BAB II TINJAUAN PUSTAKA)