function d(event) { alert(typeof(event)); } var h = document.getElementById('h'); h.onkeypress = d(event);