Skip to content

Instantly share code, notes, and snippets.

@Crydust
Forked from terkel/jquery.autofocus.js
Last active December 17, 2015 14:48
Show Gist options
  • Save Crydust/5626655 to your computer and use it in GitHub Desktop.
Save Crydust/5626655 to your computer and use it in GitHub Desktop.
jQuery(function ($) {
// detect support for input attribute
var input = document.createElement('input');
if (!('autofocus' in input)) {
$('[autofocus=]').focus(); // http://bugs.jquery.com/ticket/5637
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment