禁止chrome浏览器自动填充表单的解决方案

经过测试,对chrome42,重写input: auto-fill样式不起作用,加上autocomplete="off"也不起作用。

因此使用了两个隐藏的输入框:

<input type="text" style="display:none"/>

<input type="password" style="display:none"/>

将表单标签<form></form>去掉,加上autocomplete="off"

浏览器会将保存的信息填到这两个隐藏输入控件上,达到了想要的效果。

原文地址:https://www.cnblogs.com/ld-swust/p/5801606.html