Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
32 lines (29 sloc) 565 Bytes
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Key Events</title>
<style>
p {
margin: 0;
padding: 0;
}
</style>
<script src="http://code.jquery.com/jquery-1.4.2.js"></script>
<script>
$(function() {
function log( event ) {
$( "#log" ).prepend( "<p>" + event.type + ": " + event.keyCode + "</p>" );
if ( console && console.log ) {
console.log( event.type, event );
}
}
$( "#test" ).bind( "keydown keypress keyup input paste", log );
});
</script>
</head>
<body>
<input id="test">
<div id="log"></div>
</body>
</html>
Something went wrong with that request. Please try again.