html disabled autocomplete code example
Example 1: disable browser autocomplete
<form method="post" action="/form" autocomplete="off">
[…]
</form>
Example 2: input disable autocomplete
autocomplete="off"
Example 3: autocomplete source disable element
$( "#tags" ).autocomplete({
source: availableTags,
focus:function(e, ui){
return ui.item.idx<=2;
},
select:function(e, ui){
return ui.item.idx<=2;}
}) .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
item.idx=ul[0].childElementCount;
return $( "<li>" )
.toggleClass('disable',ul[0].childElementCount>2)
.append( "<a>" + item.label + "</a>" ).appendTo( ul );
};