Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(function(){ //jq do some work! - when ever the DOM is ready, do the stuff in here!
- $(document).keypress(function(e) { // look at the keypressed
- if(e.which == 97) { // use some logic to see what key was pressed
- alert('You pressed "A"!'); //do something when that key was pressed
- }
- });
- ///////USE BELOW TO FIGURE OUT KEY NUMBERS!
- $(document).keypress(function(e) {
- console.log("keypressed: " + e.which);
- });
- }); // stop doing jquery sutff
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement