<input id=h> <script>function d(event) {alert(typeof(event)); }; var h = document.getElementById('h'); h.onkeypress = d; </script>