Last active
August 29, 2015 14:11
-
-
Save fastcodecoq/2d1aee7d8a4040f6f493 to your computer and use it in GitHub Desktop.
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
(function($){ | |
$.fn.Focus = function(){ | |
$(this).focus(); | |
$(this).attr('autofocus',''); | |
} | |
$(function(){ | |
$("*[autofocus]").focus(); | |
$("*[data-autofocus]").focus(); | |
$("*[autoFocus]").focus(); | |
}); | |
})(jQuery); | |
// uso | |
// $('element').Focus(); | |
// <input data-autofocus> | |
// <input autofocus> | |
// <input autoFocus> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment