Prevent default keyCode 38 and 40
<p>How can I prevent the page from scrolling when I press the up and down buttons. KeyCodes 38 and 40. I tried </p>

<pre><code>$(window).on("click", function(event){
  var keyCode = event.which;
  if(keyCode == 38 || keyCode == 40){
    preventDefault();
  }
});
</code></pre>

<p>But it doesn't seem to prevent the page scroll in IE</p>
