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

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

Review Pemakaian Lenovo K900 Mati Total (Matot)

VERIFIKASI SUARA MENGGUNAKAN METODE MFCC DAN DTW MENGGUNAKAN METODE MFCC DAN DTW (BAB III METODE DAN PERANCANGAN SISTEM)