Posted By

kennonb on 10/08/10


Tagged

browser keypress


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

aunlead


jQuery Accessible Keys


 / Published in: jQuery
 

  1. //Only needed for Webkit Browsers
  2.  
  3. if ($.browser.webkit) {
  4. $(document).keypress(function(event) {
  5.  
  6. // ALT + H in case there is other text entry on the page
  7. if (event.charCode == 729) {
  8. window.location = $('a[accesskey=h]').attr('href');
  9. }
  10.  
  11. console.log(event.charCode); //Log the key code
  12. });
  13. }

Report this snippet  

You need to login to post a comment.