Skip to content

Instantly share code, notes, and snippets.

@klaasvw
Created September 7, 2012 07:56
Show Gist options
  • Save klaasvw/3664209 to your computer and use it in GitHub Desktop.
Save klaasvw/3664209 to your computer and use it in GitHub Desktop.
Making any element focusable
/**
* Some elements like headers or divs cannot gain focus. This script shows how you can enable this.
*/
// Set the tabindex to 0 so the element can gain focus. To maintain natural tab flow
// you should use 0.
$('h1').attr('tabindex', '0');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment