我已经为此奋斗了 2 年......需要你的帮助。
在移动版 chrome 中,我无法禁用 AUTOCOMPLETE ...
Chrome 忽略
autocomplete="off"
这是在 android 上,但我想也在 iPhone 上。
我有一个简单的联系表 - 没有密码或任何东西。
我绝对需要它来工作,因为在移动设备上,当 chrome 显示自动完成选项时,它会破坏用户体验。我如何强制 Chrome 移动版不显示它???
我已经阅读了关于此的所有问题,但没有任何效果 - 我不知道该怎么做
最佳答案
Chrome 在每个版本上不断改变它处理自动完成的方式,我使用 jQuery 解决了这个问题,我将所有字段设置为只读,并通过 onclick/focus 使其成为非只读。试试这个 jQuery fragment :
jQuery(document).ready(function($){
//======fix for autocomplete
$('input, :input').attr('readonly',true);//readonly all inputs on page load, prevent autofilling on pageload
$('input, :input').on( 'click focus', function(){ //on input click
$('input, :input').attr('readonly',true);//make other fields readonly
$( this ).attr('readonly',false);//but make this field Not readonly
});
//======./fix for autocomplete
});
关于javascript - 自动完成 ="OFF"不工作 - Chrome 移动版,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33404579/