-
-
Save samarpw/8a07811bc044b93c414066dfc2995425 to your computer and use it in GitHub Desktop.
:focus - get the currently focused element
This file contains hidden or 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
// Public domain, really. | |
jQuery.expr[':'].focus = function( elem ) { | |
return elem === document.activeElement && ( elem.type || elem.href ); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment