$('.class').focus();
$('#name').focus();
$('#id').focus(function(){
// do your code here
});
$('#name').trigger('focus')
$( "#target" ).focus(function() {
alert( "Handler for .focus() called." );
});
$("#button").on("click", function () {
$("#input").focus();
});