/    Sign up×
Community /Pin to ProfileBookmark

"Home" Key goes back to top but tabbing dosn’t go to first selection

When I am tabbing through, keyboard ‘home’ button does not move focus. Go to anywhere in the page with your focus, ideally some place in the middle. Press the home key. Now tab. You will NOT be at the start of the page but right where you left off (plus one tab stop of course).
I want to be able to press home key and when click tab it will tab to the first thing “Skip to Main Content” and then when I click tab it will go to the next link…

Currently I have this

[CODE] $(‘body’).on(“keyup”, function(e){
var code = (e.keyCode ? e.keyCode : e.which);
if (code === 36) {
$(‘body button:first’).focus();
}
return false;
});[/CODE]

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@rootFeb 01.2018 — 
  • 1. That is not JavaScript, its JQuery, so wrong forum.

  • 2. TABINDEX is the thing in HTML that you set to control the tabbing between elements and links.

  • 3. Interfering with the default action of a key can have consequences for the user if they need that particular key operation and your listening for that key press.


  • So the question is this, have you set up the tabindex in the elements / links on the page in question?

    *moved to JQuery forum*
    ×

    Success!

    Help @soupii spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.19,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...