I'm aware there are a lot of questions regarding navigation using keyboard events. However, as I want to understand everything and not just copy-paste stuff I couldn't find any good explanation or tutorial about the subject.
This is what I got so far and it's working for the left and right arrows. But if someone could point me in the right direction how to make it work for the up and down arrows as well, I would be very happy! And maybe it's not the most beautiful way to solve it, but for start I just want to understand the basic!
<a class="link" href="#">Link 1</a> <a class="link" href="#">Link 2</a> <a class="link" href="#">Link 3</a> <a class="link" href="#">Link 4</a> <a class="link" href="#">Link 5</a> <br /> <a class="link" href="#">Link 1</a> <a class="link" href="#">Link 2</a> <a class="link" href="#">Link 3</a> <a class="link" href="#">Link 4</a> <a class="link" href="#">Link 5</a> if (e.which == 39) { $("a:focus").next().focus(); } if (e.which == 37) { $("a:focus").prev().focus(); }