密码输入框内禁止记住密码导致的自动填充

来源:互联网 发布:mysql下载32位 win7 编辑:程序博客网 时间:2024/06/06 09:27

一:利用html5属性

    <pre name="code" class="html"><input type="text" name="username" autocomplete="off">      <input type="password" name="pass" autocomplete="off">  

二:通过js将密码置空

    window.load = function(){           document.getElementById('id属性值').value='';       }; 

三:改变type

    input type="password" 改成 input type="text" 并在后面加上 onfocus="this.type='password'"
四:通过添加隐藏域

    <input type="text" name="name">      <input type="hidden">      <input type="password" name="pass">  


0 0