The jQuery method .focus() can help with this. However in order for it to work you may need to add in a small delay in order for the browser to pick it up.
// Click event
$('#btnSearch').click(function(){
// focus on search bar after delay
setTimeout(function () {
$('#txtSearch').focus();
}, 500);
});
No comments:
Post a Comment