How do I go about binding a function to left and right arrow keys in Javascript and/or jQuery? I looked at the js-hotkey plugin for jQuery (wraps the built-in bind function
Instead of using return false; as in the examples above, you can use e.preventDefault(); which does the same but is easier to understand and read.
return false;
e.preventDefault();