Created
November 27, 2012 20:02
-
-
Save thedamon/4156665 to your computer and use it in GitHub Desktop.
small jquery function to auto-focus inline-linked inputs. Only works for in-page links so far. Feel like this should be default browser behaviour
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
/*Auto-focus linked inputs. Only works for in-page links so far*/ | |
$('a[href^="#"]').on('click', function(e){ | |
target = $(this).attr('href'); | |
$(target).filter(':input').focus(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment