标签:password html disabled url 无法 site form doc 字符
原理:
display:none;
隐藏用,隐藏后不占位置visibility:hidden;
隐藏用,隐藏后占原来的位置position:absolute;z-index:-1;
隐藏用,隐藏与否取决于z-index
相对的值autocomplete:"off";
这个属性有时失效,有个解决办法是将off
改为new-password
实现
<input type="text" value="admin" style="position: absolute;z-index: -1;" disabled autocomplete = "off"/><!-- 这个username会被浏览器记住,随便用个admin-->
<input type="password" value=" " style="position: absolute;z-index: -1;" disabled autocomplete = "off"/>
<p><input type="text" maxlength="20" placeholder="用户名" id="name" name="name" autocomplete = "off"/></p>
<p><input type="password" maxlength="20" placeholder="密码" id="pwd" name="pwd" autocomplete = "off"/></p>
<p><input type="text" maxlength="4" placeholder="验证码" id="vcode" name="vcode" autocomplete = "off"/><img id="vcode" title="点击更换验证码" /></p>
<p><input type="button" value="登录" id="login"/></p>
<p style="visibility: hidden;"><input type="password" value=" " style="position: absolute;z-index: -1;" disabled autocomplete = "off"/></p><!-- 这个password的值会被浏览器记住,随便用个空格 -->
参考:
标签:password html disabled url 无法 site form doc 字符
原文地址:https://www.cnblogs.com/EricZLin/p/12833807.html