Created
February 22, 2011 13:46
-
-
Save olivere/838674 to your computer and use it in GitHub Desktop.
A test for keyboard events
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>jQuery Keypress Demo</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script> | |
<script> | |
$(function() { | |
$(document).keypress(function(e) { | |
console.dir(e); | |
$('<li></li>').html(e.which).appendTo($('#keys')); | |
}); | |
}); | |
</script> | |
</head> | |
<body> | |
<h1>Press any key</h1> | |
<ul id="keys"></ul> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment