I have a question related to the code below. The code is used to force focus to the '#skiptocontent' element when the User tabs into the window. The problem I am having is that when I tab all the way through the site and end up at the address bar again, I can't tab back into the window. Are there any suggestions why this might be happening? & maybe a better way to accomplish this?
$(window).keydown(function(e) {
if(e.keyCode === 9 && $("#skiptocontent a") !== undefined && $("#skiptocontent a").attr("data-focused") === "false") {
$("#skiptocontent a").focus();
$("#skiptocontent a").attr("data-focused", "true");
return false;
}
return true;
});