JSFiddle - React, Tailwind, and code Playground

HTML

<div id="north">North</div>
<div id="west">West</div>
<div id="center">Center</div>

JavaScript

$(document).ready(function() {
    
    var divs = ["north", "west", "center"];
    var startIndex = 0;
    $(document).keydown(function(e) {
        if (e.which == 9) {
            $("div").css("border", "");
            $("#" + divs[startIndex]).css("border", "4px solid gray");
            startIndex++;
            if(startIndex === divs.length) {
                startIndex = 0;                   
            }
        }
        return false;
    });
});