首页 > 其他 > 详细

怎么禁止自动填充浏览器记住的密码

时间:2020-05-11 14:26:08      阅读:49      评论:0      收藏:0      [点我收藏+]

重点看标红的

<input type="text" style="display:none" disabled autocomplete = "off"  value=" ">
 <input name="用户名" type="text" id="username"  autocomplete="off"/><i>用户名</i>
 <input type="password" style="display:none" disabled autocomplete = "off" value=" ">
 <input name="密码" type="text" οnfοcus="this.type=‘password‘" id="userpwd" autocomplete="off" /><i>密码</i>

或者  <input name="密码" type="password" readonly οnfοcus="this.removeAttribute(‘readonly‘);" id="userpwd" autocomplete="off" /><i>密码</i>

 

在文档加载完成后将用户名、密码输入内框设置为容空

window.load=function(){document.getElementById(‘密码域ID‘).value=‘‘;};

或者

document.getElementById(‘username‘).value=‘‘;
                    document.getElementById(‘userpwd‘).value=‘‘;

 

怎么禁止自动填充浏览器记住的密码

原文:https://www.cnblogs.com/baobeiqi-e/p/12868669.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!