Advertisement
Guest User

Untitled

a guest
Apr 21st, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. $(function(){ //jq do some work! - when ever the DOM is ready, do the stuff in here!
  2.  
  3. $(document).keypress(function(e) { // look at the keypressed
  4. if(e.which == 97) { // use some logic to see what key was pressed
  5. alert('You pressed "A"!'); //do something when that key was pressed
  6. }
  7. });
  8.  
  9. ///////USE BELOW TO FIGURE OUT KEY NUMBERS!
  10. $(document).keypress(function(e) {
  11. console.log("keypressed: " + e.which);
  12.  
  13. });
  14.  
  15. }); // stop doing jquery sutff
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement