禁用 浏览器记住密码的方式

xiaoxiao2021-02-28  63

1.把input type=”password” 改成 input type=”text” 并在后面加上 οnfοcus=”this.type=’password'”, 2.在文档加载完成后将密码输入框设置为空: window.load = function(){ document.getElementById('密码域ID').value=''; }; 3.在用户名和密码之间加上一个隐藏的文本框: <input type="text" name="name"> <input type="hidden"> <input type="password" name="pass"> 4.使用HTML5的属性: <pre name="code" class="html"><input type="text" name="name" autocomplete="off"> <input type="password" name="pass" autocomplete="off">
转载请注明原文地址: https://www.6miu.com/read-84054.html

最新回复(0)