方法一、form 表单 、input 输入框 设置属性 autocomplete="off";
<form action="login" method="post" autocomplete="off"> </form>
<input autocomplete="off">
方法二、正对有passpword的情况,chrome 对autocomplete="off";失效;(亲测成功)
解决办法为让password 的输入框 默认是 readonly=true;当点击password框时,设置password输入框为readonly=false可以解决用户名和密码自动填充的情况;
<form action="login" method="post" autocomplete="off"> <input class="easyui-textbox" id="username" name="username" data-options="cls:'login-text-icon',iconCls:'iconfont icon-musesuser-fill',labelAlign:'right',labelWidth:100,label:'<s:message code="I.LOGIN.USERNAME"></s:message>' ,width:450" autocomplete="off"> <br> <br> <input class="easyui-textbox" id="password" name="password" data-options="cls:'login-text-icon',iconCls:'iconfont icon-museslock',labelAlign:'right',labelWidth:100,label:'<s:message code="I.LOGIN.PASSWORD"></s:message>',type:'password',readonly:true,width:450" autocomplete="new-password"> <br> <br> <input class="easyui-checkbox" name="remember" value="Y" checked=true labelWidth=100 width=400 labelAlign='right' label="<s:message code="I.LOGIN.REMEMBER"></s:message>"> <br> <br> <a id="btn" onclick="login()" class="easyui-linkbutton" style="margin-left:100px;background:#ffab3f" data-options="width:340"><s:message code="I.LOGIN.LOGIN.BTN"></s:message></a> </form>
$(function(){ $("#password").textbox('textbox').bind('click', function(){ $("#password").textbox('readonly',false); }) })
标签:总结,off,填充,autocomplete,输入框,readonly,input,password,textbox From: https://www.cnblogs.com/lixiuming521125/p/17384331.html