-
-
Save djom202/b2bbd2a0d109905486bc 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