Skip to content

Instantly share code, notes, and snippets.

@jorgemanrubia
Created November 24, 2010 18:05
Show Gist options
  • Save jorgemanrubia/714101 to your computer and use it in GitHub Desktop.
Save jorgemanrubia/714101 to your computer and use it in GitHub Desktop.
JQuery selector for currently focused element
$.expr[':'].focus = function(a){
return (a == document.activeElement);
}
$(".:focus"); // The currently focused element
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment