The following works fine on IE6, IE7, and chrome. Not working on ff 3.0.7.
<html><head>
<script src="prototype.js" type="text/javascript" ></script>
<script type="text/javascript">
Event.observe(window, 'load',
function(){
Event.observe(document.body, 'keydown', myEventHandler);
alert('window load');
});
function myEventHandler(evt) {
alert(evt);
}
</script>
</head>
<body >
<input type="text" /><br><br>
</body></html>
EDIT: By "not working" I mean myEventHandler is not firing in firefox.
EDIT2: Furthermore, it works fine when focus is on the input element. I want it fire for all keydowns.