2015-10-03 75 views
-2

我無法禁用Chromes autocomplete功能,因爲它對開發人員非常有幫助,但也很麻煩。完全避免Chrome自動完成

這是我最終的,非常簡單的解決方案,我還沒有在互聯網上找到。

回答

-1
function DisableAutocomplete(){ 
    $('[autocomplete="off"]').prop('disabled', true); 
    setTimeout(function(){ 
     $('[autocomplete="off"]').prop('disabled', false) 
    }, 600); 
} 

$(document).ready(function() { 
    DisableAutocomplete(); 
}.ajaxComplete(function() { 
    DisableAutocomplete(); 
}); 

只需將autocomplete屬性添加到HTML元素即可。

<input type="password" autocomplete="off" />