JQuery Event Keypress to find out Which key was pressed? A-Z, & @ - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:keypress

Description

JQuery Event Keypress to find out Which key was pressed? A-Z, & @

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-1.6.4.js"></script> 
  <script type="text/javascript" src="http://www.openjs.com/scripts/events/keyboard_shortcuts/shortcut.js"></script> 
  <script type="text/javascript">
    $(function(){//  w ww  . j  av a 2 s.  c om
shortcut.add("Shift+2",function() {
    console.log("@ is pressed");
});
    });

      </script> 
 </head> 
 <body>  
 </body>
</html>

Related Tutorials