Created
September 7, 2012 07:56
-
-
Save klaasvw/3664209 to your computer and use it in GitHub Desktop.
Making any element focusable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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