Posted By

jobyktom on 07/05/11


Tagged


Versions (?)

key event type and key code


 / Published in: jQuery
 

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script src="http://code.jquery.com/jquery-git.js"></script>
  5. </head>
  6. <body>
  7.  
  8. <input id="whichkey" value="type something">
  9. <div id="log"></div>
  10. <script>$('#whichkey').bind('keydown',function(e){
  11. $('#log').html(e.type + ': ' + e.which );
  12. }); </script>
  13.  
  14. </body>
  15. </html>

Report this snippet  

You need to login to post a comment.