"+ item.label + " "; }else{ var html = ""+ item.label + "
"; } return $( "
" ) .data( "item.autocomplete", item ) .append(html) .appendTo( ul ); }; $('.search-sites').on("click",function(){ setTimeout(function(){ $("#search_in_site").focus(); }, 300); });