[英]disable autosuggest/autocomplete on chrome/safari on my website
autosuggestion/ autocomplete on input box in safari Safari的输入框上的自动建议/自动完成
Hey guys I am trying to turn off the auto-complete/ auto-suggestion that comes on the input box on my website. 大家好,我正在尝试关闭网站输入框上的自动完成/自动建议功能。 (The issue is both with Google chrome and Safari). (问题出在Google chrome和Safari上)。
I want to turn it off for any user who comes to my website ie from the code not the settings of the browsers. 我想关闭所有访问我网站的用户,即通过代码而不是浏览器的设置。
I have already tried a variety of things like auto-complete = "off" , auto-complete = "false" , css styling of "display: none" and also jquery hacks like var x = document.getElementsByClassName() x.autocomplete = 'off'; 我已经尝试过各种方法,例如auto-complete =“ off”,auto-complete =“ false”,css样式为“ display:none”以及jquery hacks,例如var x = document.getElementsByClassName()x.autocomplete = “关闭”;
But nothing seems to work here. 但是,这里似乎没有任何工作。 Can anyone please tell me the solution to the above problem . 任何人都可以告诉我上述问题的解决方案。 Also the version of chrome is : 53.0.2785.143 and safari is : 9.1.1 (11601.6.17) chrome的版本是:53.0.2785.143和safari的版本是:9.1.1(11601.6.17)
Thanks! 谢谢!
In some cases, the browser will keep suggesting autocompletion
values even if the autocomplete
attribute is set to off. 在某些情况下,即使将autocomplete
属性设置为off,浏览器也会继续建议autocompletion
值。 So try once assigning random string to atrribute. 因此,尝试一次将随机字符串分配给atrribute。
autocomplete="nope"
Since this value is not valid one , the browser must give up. 由于此值无效,因此浏览器必须放弃。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.