Skip to content

Instantly share code, notes, and snippets.

@gabalis
Created September 29, 2015 10:31
Show Gist options
  • Save gabalis/4ba7cd082dadefe9e3d0 to your computer and use it in GitHub Desktop.
Save gabalis/4ba7cd082dadefe9e3d0 to your computer and use it in GitHub Desktop.
Add tabindex to all elements which do not have one yet
// adding tabindex to all relevant elements which need it
// so we exclude the tabindexed elements
// tabindex = 0 will come after the positively numbered elements
// cf http://www.w3.org/TR/html401/interact/forms.html#adef-tabindex
jQuery(document).ready(function($) {
$('a, input, select, button, textarea').not('[tabindex]').attr('tabindex',0);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment