$('body').keydown(function(e){ var key = e.which; if((key == "37")||(key == "38")||(key == "39")||(key == "40")) e.preventDefault(); });