首页 > 分享 > 解决input type=password的历史记录和自动填充问题

解决input type=password的历史记录和自动填充问题

最新推荐文章于 2023-12-25 16:07:29 发布

欢大喜。 于 2020-10-28 14:15:22 发布

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

解决input type=password的历史记录和自动填充问题

基于现在的浏览器很多都有记住密码的功能,所以很多的时候输入框会自动填充,但是在开发过程中,也会有用户觉得存在安全问题,下面是几种去除自动填充和历史记录的方法:

autocomplete=“off”

<input type="password" name="password" autocomplete="off"/> 1 autocomplete=“new-password”

<input type="password" name="password" autocomplete="new-password"/> 1 readonly οnfοcus=“this.removeAttribute(‘readonly’);”

<input type="password" name="password" readonly onfocus="this.removeAttribute('readonly');"> 1 type=“text” οnfοcus=“this.type = ‘password’”

<input class="login_ipt" type="text" name="password" onfocus="this.type = 'password'" autocomplete="new-password"/> 1 input type=“password” name=“password” style=“display:none”

<input type="password" name="password" style="display:none"> <input class="login_ipt" type="password" name="password" /> 12

相关知识

自定义(滑动条)input[type=“range”]样式
前端——table标签和form标签和控件:table,input的type类型,select和option,label,textarea
使input type=“file” 不可编辑
设置type=“range”为vertical
input type=range 进度条的自定义样式
input[type=“file”] change事件第二次不触发
Input length = 1和Input length = 2的异常解决
基于php花店订购管理系统设计与实现(源码+lw+部署文档+讲解等)
点击input checkbox之后代码里面自动添加checked=“checked”
HTML网页设计:十一、表单

网址: 解决input type=password的历史记录和自动填充问题 https://m.huajiangbk.com/newsview945721.html

所属分类:花卉
上一篇: Shell命令记录.bash
下一篇: 历史上有些科学家曾把相等位移内速