Try this:
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("input").keypress(function (e) {
if (!(e.which >= 65 && e.which <= 90) && !(e.which >= 97 && e.which <=122)) {
alert(String.fromCharCode(e.keyCode | e.charCode));
}
});
});
</script>
</head>
<body>
<input style="width: 100px">
</body>
</html>